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.