On Mon, Jan 10, 2011 at 07:56:49AM -0800, trey85stang wrote: > 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?
No, you're still learning. Here's how to do it (well, one way to do it): class role::basic_host { host { 'localhost': ip => '127.0.0.1', host_aliases => 'localhost.localdomain', ensure => 'present' } host { $fqdn: ip => $primary_ipaddress, host_aliases => $hostname, ensure => 'present' } 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 } } node host1 { $primary_ipaddress = '192.168.1.1' include role::basic_host } node host2 { $primary_ipaddress = '192.168.1.2' include role::basic_host } node host3 { $primary_ipaddress = '192.168.1.3' include role::basic_host include some::other::class } You see? No need to define each host resource separately for each node (nodes are what puppet-configured hosts/computers are called in Puppet). What you do is you use classes to group together a linked set of resources, then you include the appropriate classes in your nodes. Notice that I added a couple of other important entries to the list of host resources (you wouldn't want to be without those, and the "purge => true" line would otherwise remove them)). Note also that I don't need to specify the values of $fqdn and $hostname, because these are "facts" which puppet can find out for itself (I do specify $primary_ipaddress in this example, because a host may have more than one address, not all of which will be associated with the primary hostname). Keep asking about anything which doesn't make sense yet. -- Bruce The ice-caps are melting, tra-la-la-la. All the world is drowning, tra-la-la-la-la. -- Tiny Tim.
signature.asc
Description: Digital signature