On Fri, Jun 25, 2010 at 1:04 PM, Silviu Paragina <sil...@paragina.ro> wrote: > On 25.06.2010 19:42, Douglas Garstang wrote: >> >> I had started converting my node manifests to external nodes (in yaml >> format), to make them machine readable/writable, so that we could >> write scripts to parse them. However, I really can't get it right in >> my head that by doing that I am forced to pass parameters to classes >> by setting a series of variables in the node. It just doesn't seem >> right to me. It's a lot less readable than using a definition which at >> least indicates some sort of intent on what the variables are for and >> how they are used. >> > > External nodes are powerful because they allow a script to generate some > standard variables, and to break some inheritance rules which are present in > the nodes.pp. So if you are just creating yaml files for nodes it's probably > not a good idea. Where is good will probably be the next question. Well a > lot of places. If you want to store your info in AD along with the windows > machines this is a good way. Or if you want a web interface.
Yes, but you lose the ability to use definitions, which is a HUGE problem. As I said earlier, if you can't use definitions in your node manifests, then you have to put the definitions into modules, set variables in the nodes, and then include those modules. This makes the configuration far less readable. The only reason I was looking at external nodes was because we wanted to store all the data passed from the nodes to the modules in a machine readable format. > > The clear advantage over nodes.pp would be in a case where you would want to > override the value of a variable in a derived class. In the nodes.pp if the > variable is used in an include in the base node even if you override it you > won't gain anything. On the other hand, here, because you generate the yaml > dynamically you can set the variables before the includes, and also have > some inheritance defined and understood only by the script (ie puppet will > only get the final result). Not sure I follow, but this: classes: - moduleA parameters: - key1: var1 - key2: var2 - key3: var3 class moduleA { <do something with key1> } is a LOT less readable than: node A { definition1 { name: key1 => var1 } } define definition1 { <do something with key1> } Doug -- 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.