Hello, Is it possible to group many nodes together? Suppose I have a large number of machines that I all want to have the same config - rather than specify them as individual nodes each inheriting the same config, I''d like to say that a group inherits a config, and define the group elsewhere. Does this sort of construction already exist? Could it be cobbled together from what we already have? Is there any chance of such a feature in the future? S.
This is the type of thing that external node classify was created for http://reductivelabs.com/trac/puppet/wiki/ExternalNodes I''m not aware of any way to do this directly within the puppet language. Thanks Brian On Nov 13, 2007 9:14 AM, Stephen Nelson-Smith <stephen@atalanta-systems.com> wrote:> Hello, > > Is it possible to group many nodes together? Suppose I have a large > number of machines that I all want to have the same config - rather > than specify them as individual nodes each inheriting the same config, > I''d like to say that a group inherits a config, and define the group > elsewhere. > > Does this sort of construction already exist? Could it be cobbled > together from what we already have? Is there any chance of such a > feature in the future? > > S. > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
On Tue, Nov 13, 2007 at 05:14:03PM +0000, Stephen Nelson-Smith wrote:> Is it possible to group many nodes together? Suppose I have a large > number of machines that I all want to have the same config - rather > than specify them as individual nodes each inheriting the same config, > I''d like to say that a group inherits a config, and define the group > elsewhere.Say, something like: node ''web01.example.com'', ''web02.example.com'', ''web03.example.com'' { include some_class include some_other_class webserver { foo: mode => ''cluster'' } } Or perhaps: node ''webserver'' { include some_class include some_other_class webserver { foo: mode => ''cluster'' } } node ''web01.example.com'' inherits ''webserver'' { local_config { web01: node_order => ''first'' } } node ''web02.example.com'' inherits ''webserver'' { local_config { web02: node_order => ''second'' } } node ''web03.example.com'' inherits ''webserver'' { local_config { web03: node_order => ''third'' } } It''s all in the docs. - Matt -- "[Perl] combines all the worst aspects of C and Lisp: a billion different sublanguages in one monolithic executable. It combines the power of C with the readability of PostScript." -- Jamie Zawinski
On 13/11/2007, at 18.14, Stephen Nelson-Smith wrote:> Is it possible to group many nodes together? Suppose I have a large > number of machines that I all want to have the same config - rather > than specify them as individual nodes each inheriting the same config, > I''d like to say that a group inherits a config, and define the group > elsewhere.Well you can always do: node base_webserver_node { include apache2 include mysql5 include php5 include webadm } node "web01.example.com" inherits base_webserver_node { $dv = "etch" } node "web02.example.com" inherits base_webserver_node { $dv = "sarge" } But I don''t know if that is what you want...? -- Med venlig hilsen Juri Rischel Jensen Fab:IT ApS Vesterbrogade 50 DK-1620 København Tlf: 70 202 407 / Fax: 33 313 640 www.fab-it.dk / juri@fab-it.dk
On Nov 13, 2007, at 2:28 PM, Juri Rischel Jensen wrote:> node "web01.example.com" inherits base_webserver_node { > $dv = "etch" > } > > node "web02.example.com" inherits base_webserver_node { > $dv = "sarge" > }You can also do: node one, two, three, four inherits parent_node { ... } -- I am a kind of paranoiac in reverse. I suspect people of plotting to make me happy. --J. D. Salinger --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
"Brian Finney" <y0gi636@gmail.com> writes:> This is the type of thing that external node classify was created for > > http://reductivelabs.com/trac/puppet/wiki/ExternalNodesPossibly because we didn''t know about or didn''t understand external nodes (yet!), we created a custom fact that returned a fact called ''project''. Then in basenode we say "include $project". Maybe external nodes are better but this sure reads nicely in the config :)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 13 November 2007, Juri Rischel Jensen wrote:> On 13/11/2007, at 18.14, Stephen Nelson-Smith wrote: > > Is it possible to group many nodes together? Suppose I have a large > > number of machines that I all want to have the same config - rather > > than specify them as individual nodes each inheriting the same config, > > I''d like to say that a group inherits a config, and define the group > > elsewhere. > > Well you can always do: > > node base_webserver_node { > include apache2 > include mysql5 > include php5 > include webadm > } > > node "web01.example.com" inherits base_webserver_node { > $dv = "etch" > } > > node "web02.example.com" inherits base_webserver_node { > $dv = "sarge" > } > > But I don''t know if that is what you want...?Sorry, but that shouldn''t work, because $dv will not propagate upwards through the "inherits". If you want[1] constructions like this, use template classes as defined on http://reductivelabs.com/trac/puppet/wiki/GlossaryOfTerms#templateclass and the example at http://reductivelabs.com/trac/puppet/wiki/PuppetBestPractice#sample-templates-pp Regards, David [1] Matt has good arguments against it. - -- The primary freedom of open source is not the freedom from cost, but the free- dom to shape software to do what you want. This freedom is /never/ exercised without cost, but is available /at all/ only by accepting the very different costs associated with open source, costs not in money, but in time and effort. - -- http://www.schierer.org/~luke/log/20070710-1129/on-forks-and-forking -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHOu8s/Pp1N6Uzh0URAiAHAJ9sqDXY5gy7nmlciO84cu3C+OGnKACfTIDu Wynaqec3Aom7RK7cTi6G4C4=PLLN -----END PGP SIGNATURE-----