Thanks for the reply, It looks like I would need an entry for every host if I were to take that route? My environment would require 6000*3 entries... That doesn't seem logical.
Am I understanding this correctly? On Jan 10, 4:35 am, Bruce Richardson <itsbr...@workshy.org> wrote: > On Sun, Jan 09, 2011 at 10:42:19AM -0800, trey85stang wrote: > > > 192.168.1.20 host1.domain.com > > 192.168.1.30 host2.domain.com > > 192.168.1.250 unique_host.domain.com > > > Is there a way to manage this with puppet? What I would like to do is > > be able to check that those 3 entries exist... if not replace the file > > and generate the custom content that needs to be in the file? > > If you use host resources, as already recommended, Puppet will create > the entries if they do not exist. If you only want those entries > present, tell Puppet to purge all host entries not specified in the > puppet configuration for that host. > > host { 'host1.domain.com': > ip => '192.168.1.20', > ensure => 'present' > } > > host { 'host2.domain.com': > ip => '192.168.1.30', > ensure => 'present' > } > > host { 'unique_host.domain.com': > ip => '192.168.1.250', > ensure => 'present' > } > > resources { 'host': purge => true } > > Stop thinking custom scripts; start thinking resources. Most Puppet > configuration consists of specifying which resources you do or don't > want present in which circumstances. Most of the rest of it is about > defining which resources depend on which others (e.g. this running > application depends on that configuration file). You describe how a > system should look and Puppet does what is necessary to make it so. > > -- > Bruce > > I object to intellect without discipline. I object to power without > constructive purpose. -- Spock -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@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.