tobyriddell
2009-Sep-21  12:01 UTC
[Puppet Users] How to tailor config. files for groups of hosts?
Hi,
I''m trying to figure out the best way to generate tailored config.
files for several sets of hosts. Here''s a concrete example with a
sudoers file:
class hostgroups {
    $devhosts = [ "devhost1", "devhost2" ]
    $prodhosts = [ "prodhost1", "prodhost2" ]
    $ukhosts = $devhosts + $prodhosts
}
Template sudoers file:
<% if @devhosts.include?@hostname %>
# Allow developers root access on dev. boxes
user1 devhost1=(root) /bin/su -
user1 devhost2=(root) /bin/su -
<% end %>
<% if @prodhosts.include?@hostname %>
# Only admins get root on prod. boxes
admin1 prodhost1=(root) /bin/su -
admin1 prodhost2=(root) /bin/su -
<% end %>
I''m sure this is something that has been done before - am I doing it
the best way?
Thanks.
Toby
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---