Virtual_user
2014-Mar-04 21:56 UTC
[Puppet Users] Syntax for echoing Fqdn name inside a hash value (please help)
Hi i am using puppet 2.7 i want to echo the Fqdn name in a template by using looping through the hash, Example, in site.pp i have $acc_sudo = $mc_servertype ? { 'system' => [ '%APP *<%= fqdn %>* =/etc/init.d/httpd start, /etc/init.d/httpd stop,/etc/init.d/httpd restart, /sbin/services httpd restart' ], 'db' => [ '%DB <%= fqdn %> =/etc/init.d/oracle start'], 'app' => ['%APP <%= fqdn %> =/etc/init.d/httpd start, /etc/init.d/httpd stop,/etc/init.d/httpd restart, /sbin/services httpd restart' ], } and sudo.erb file i have <% if mc_servertype == "system" %> <% acc_sudo.each do |sudo| %><%= sudo %><% end %> <% end %> problem is, when its generating the sudo file, its writing like this %APP *<%= fqdn %>*=/etc/init.d/httpd start, /etc/init.d/httpd stop,/etc/init.d/httpd restart, /sbin/services httpd restart but i want to make it like this %APP server1.test.co=/etc/init.d/httpd start, /etc/init.d/httpd stop,/etc/init.d/httpd restart, /sbin/services httpd restart what will be the right syntax for it in site.pp ?? please help with this. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/3f966768-7c1f-4c24-975f-97d0fdc6a8cb%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.