This sounds like standard file template should work, for that file, use content => template("your-class/your-template.erb");
Then in that file (your-template.erb) you can have: static stuff.... <% if location == "us-west-1c -%> something <% else %> default stuff <% end %> more static stuff The else is optional. Syntax not guaranteed :-) On Tue, Apr 3, 2012 at 2:01 PM, Jim Dehune <jimdeh...@gmail.com> wrote: > Hi all, > > New to puppet and am hoping I can be pointed in the right direction. > > I have several Amazon EC2 instance in us-east, us-west, eu, and apac. > I need different /etc/hosts file for each region. I'm not sure how to > implement this in each servers node definition. > > I'd like to have something like this: > > node server101 { > $location = us-west-1c > ... > .. > } > > and have it setup the hosts file with the appropriate entries needed > from a template. facter has 'ec2_placement_availability_zone' which > has the location info I need. > > What do I need to read more about to accomplish this in my classes. > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.