Douglas Garstang
2010-Jun-25 16:42 UTC
[Puppet Users] To External Nodes, or not to External Nodes
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. Am I the only person in the universe who thinks this? The only alternative I can see is the extlookup() function, which at least lets me use definitions in my node manifests, and therefore keeps the intent and is more readable, while at the same time storing machine parseable data in an external file. Do I have any other options? 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-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Peter Meier
2010-Jun-25 20:00 UTC
Re: [Puppet Users] To External Nodes, or not to External Nodes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1> Do I have any other options?waiting for 2.6 which will have class parameters. cheers pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwlCvoACgkQbwltcAfKi3+A2gCfS6b8MCaZ9rY1Qz2Ms5xEZyhP RKAAn2NK6qarvFLZKcGXCjcdhi6ytNm9 =YsU9 -----END PGP SIGNATURE----- -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Silviu Paragina
2010-Jun-25 20:04 UTC
Re: [Puppet Users] To External Nodes, or not to External Nodes
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. 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). It would be wise to try this with foreman or puppet dashboard. I''m not sure if I''ve hit your question right. If I''ve misunderstood it sorry my bad. :"> :) Silviu> Am I the only person in the universe who thinks this? > > The only alternative I can see is the extlookup() function, which at > least lets me use definitions in my node manifests, and therefore > keeps the intent and is more readable, while at the same time storing > machine parseable data in an external file. > > Do I have any other options? > > 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-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Douglas Garstang
2010-Jun-26 22:11 UTC
Re: [Puppet Users] To External Nodes, or not to External Nodes
On Fri, Jun 25, 2010 at 1:04 PM, Silviu Paragina <silviu@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-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.