On Mon, Aug 27, 2012 at 08:10:34AM -0700, jcbollinger wrote: > > > > # cat common.yaml > > > > --- > > > > searchdomain : 'example.com' > > > > ssh_auth : ldap > > > > servers : > > > > server-a : > > > > sshd_auth: "local" > > > > ClientAliveInterval: "nil" > > > > ClientAliveCountMax: "nil" > > > > server-b : > > > > sshd_auth: "local" > > > > ClientAliveInterval: "nil" > > > > ClientAliveCountMax: "nil" > > > > server-c : > > > > sshd_auth: "ldap" > > > > ClientAliveInterval: "nil" > > > > ClientAliveCountMax: "nil" > > > > server-d : > > > > sshd_auth: "ldap" > > > > ClientAliveInterval: "10" > > > > ClientAliveCountMax: "3" > > > >
> Furthermore, you may be approaching this altogether the wrong way. If it > is part of the nature of sshd_lookup that no node will ever need to declare > more than one instance, then sshd_lookup should probably be a class instead > of a definition: > > class sshd_lookup { > > $all_data = hiera_hash('servers') > $node_data = $all_data[$hostname] > > $sshd_auth = $node_data['sshd_auth'] > $ClientAliveInterval = $node_data['ClientAliveInterval'] > $ClientAliveCountMax = $node_data['ClientAliveCountMax'] > $server_role = $node_data['server_role'] > $location = $node_data['location'] > $sshd_type = $data[$hostname]['sshd_auth'] > > # ... > } > Hi: I've been in a hole for while now and my puppet setup was working (albeit, very inefficiently and harder to read) until I upgraded recently, to puppet 3.0.x, so I came back to this thread. This approach of getting the entire hash out of the YAML via hiera from a class (as detailed above) instead of a defined type solved my problem and is much more elegant. I am still configuring all my hosts in a single YAML file Hash of Hashes (HoH). You questioned the approach and here it is: 1.) All hosts are in the node default 2.) The node default calls a single master module which parses the YAML HoH based on the facter hostname and performs role logic in puppet DSL and calls every other necessary module/manifest as the roles dictate. Every node is fully defined for every variable in the YAML file. Only this module should have configuration data in it. I suppose it could use ruby DSL if we wanted to here also. node default --> master_module w/ YAML HOH lookup and role logic --> other modules (dns, ssh, ldap, sudo) The only other module/manifest I haven't been able to remove configuration data from is local ssh users, ssh keys etc. I suppose I could place users and ssh keys in another YAML file of structured data. Thanks, -dkw > > John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.