Hi, Forgive the newbie questions but I''m just starting out here in puppet land... In site.pp can I define ''groups'' of computers and then apply classes to those groups, rather than machine by machine? So I have my Debian group and they get their "policies" (yes, I''m coming from managing AD servers!), my Ubuntu group, my mailservers group etc etc, so I can apply both group and individual settings to any machine. And speaking of Debian/Ubuntu... I see puppet can differentiate between os''es, can it distinguish different distributions in the same way. I''d like a single sources.list policy and to have the file uploaded depend on the flavour of Linux. Thanks, Steve Rippl Woodland School District _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Steve Rippl wrote: | In site.pp can I define ''groups'' of computers and then apply classes to | those groups, rather than machine by machine? So I have my Debian group | and they get their "policies" (yes, I''m coming from managing AD | servers!), my Ubuntu group, my mailservers group etc etc, so I can apply | both group and individual settings to any machine. You can''t define groups as such. You still need individual node definitions but you can use inheritance or similar methods to group together multiple nodes. Also look at the idea of default or "base" nodes. The examples on the Wiki are a good place to start. | And speaking of Debian/Ubuntu... I see puppet can differentiate between | os''es, can it distinguish different distributions in the same way. I''d | like a single sources.list policy and to have the file uploaded depend | on the flavour of Linux. Yes - look at the operatingsystem and operatingsystemrelease facts. I just added support to identify Ubuntu and the particular Debian/Ubuntu releases. It should be in the forthcoming Facter 1.3.9 release. Regards James Turnbull - -- James Turnbull (james@lovedthanlost.net) - -- Author of: - - Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) - - Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) - - Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHq4MM9hTGvAxC30ARAvdCAKC4I+Et6uj6VspNc2FM4hXuDZZ49QCgk18g ZeJBmFrHHZsANGZ68wFU9PQ=6oDC -----END PGP SIGNATURE-----
On Feb 7, 2008, at 4:15 PM, James Turnbull wrote:> | And speaking of Debian/Ubuntu... I see puppet can differentiate > between > | os''es, can it distinguish different distributions in the same > way. I''d > | like a single sources.list policy and to have the file uploaded > depend > | on the flavour of Linux. > > Yes - look at the operatingsystem and operatingsystemrelease facts. I > just added support to identify Ubuntu and the particular Debian/Ubuntu > releases. It should be in the forthcoming Facter 1.3.9 release.And in the mean time, you can use the LSB facts. -- A citizen of America will cross the ocean to fight for democracy, but won''t cross the street to vote in a national election. --Bill Vaughan --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Use classes. Class debian { Include debian_stuff Include other_stuff } Node debian-box { Include debian } You can also differentiate between debian and ubuntu by $operatingsystem and $lsb* facter variables root@puppet:/tmp# facter|egrep "(^lsb|operatingsystem)" lsbdistcodename => feisty lsbdistdescription => Ubuntu 7.04 lsbdistid => Ubuntu lsbdistrelease => 7.04 operatingsystem => Debian operatingsystemrelease => 2.6.20-16-server i.e.; node debian-box case $lsbdistid { debian: { include debian } } include otherstuff } You can also do: node puppet { debug "trying to include class $lsbdistid" include $lsbdistid debug "trying to include class $lsbdistcodename" include $lsbdistcodename } class ubuntu { debug "Test" file { "/tmp/test": content => "blah", ensure => file; } } class feisty { debug "Feisty" file { "/tmp/distro": content => "good", ensure => file; } } Outputs: info: Loading fact acpi_available info: Loading fact netmask info: Loading fact interfaces debug: Scope(Node[puppet]): trying to include class Ubuntu debug: Scope(Class[ubuntu]): Test debug: Scope(Node[puppet]): trying to include class feisty debug: Scope(Class[feisty]): Feisty debug: Creating default schedules debug: Finishing transaction -610904568 with 0 changes debug: //Node[puppet]/ubuntu/File[/tmp/test]: File does not exist debug: //Node[puppet]/ubuntu/File[/tmp/test]: Changing ensure debug: //Node[puppet]/ubuntu/File[/tmp/test]: 1 change(s) notice: //Node[puppet]/ubuntu/File[/tmp/test]/ensure: is absent, should be file (noop) debug: //Node[puppet]/feisty/File[/tmp/distro]: File does not exist debug: //Node[puppet]/feisty/File[/tmp/distro]: Changing ensure debug: //Node[puppet]/feisty/File[/tmp/distro]: 1 change(s) notice: //Node[puppet]/feisty/File[/tmp/distro]/ensure: is absent, should be file (noop) debug: Finishing transaction -609224658 with 2 changes Arjuna Christensen | Systems Engineer Maximum Internet Ltd 7a Parkhead Pl, Albany, North Shore, 0632 | PO Box 8006, Auckland, 1150, NZ DDI: + 64 9 913 9683 | Ph: +64 9 915 1825 | Fax:: +64 9 300 7227 arjuna.christensen@maxnet.co.nz <mailto:arjuna.christensen@maxnet.co.nz> | www.maxnet.co.nz <http://www.maxnet.co.nz/> ________________________________ Maxnet | mission critical internet ________________________________ This email (including any attachments) is confidential and intended only for the person to whom it is addressed. If you have received this email in error, please notify the sender immediately and erase all copies of this message and attachments. The views expressed in this email do not necessarily reflect those held by Maxnet. From: puppet-users-bounces@madstop.com [mailto:puppet-users-bounces@madstop.com] On Behalf Of Steve Rippl Sent: Friday, 8 February 2008 11:14 a.m. To: puppet-users@madstop.com Subject: [Puppet-users] computer groups Hi, Forgive the newbie questions but I'm just starting out here in puppet land... In site.pp can I define 'groups' of computers and then apply classes to those groups, rather than machine by machine? So I have my Debian group and they get their "policies" (yes, I'm coming from managing AD servers!), my Ubuntu group, my mailservers group etc etc, so I can apply both group and individual settings to any machine. And speaking of Debian/Ubuntu... I see puppet can differentiate between os'es, can it distinguish different distributions in the same way. I'd like a single sources.list policy and to have the file uploaded depend on the flavour of Linux. Thanks, Steve Rippl Woodland School District _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Thanks, that''s the kind of thing I was looking for. And thanks for the previous factor tips on using factor to distinguish os releases. On Thu, 2008-02-07 at 15:46 -0800, Thomas Underhill wrote:> We are using LDAPNodes to setup classifications of systems -- > i.e. webserver, database server, production, etc. and then > just create an LDAP entry for that host that has an attribute > equal to the various classifications. > > i.e. Machine A is a database server and production so it has > the following puppetClass attributes: db and prod > > We then have a puppet class for db and prod: > > db might inherit the base class for the bare minimum > software/configs and then add mysql or oracle related > software/configs. prod would include items that we might only > want on a production server --- perhaps more in depth > monitoring and alerting software/configurations. > > We had an existing LDAP infrastructure so I was able to use > the LDAPNodes page on the Puppet wiki plus some insight from > Luke and a few others to get it working. The upside is that I > have no host information in any of my puppet manifests and so > I don''t have to update any manifests each time a machine is > built. I merely create a new LDAP host entry and then add > attributes for the classes that I want it to inherit. > > -Thomas > > ---- Original message ---- > >Date: Thu, 07 Feb 2008 14:14:27 -0800 > >From: Steve Rippl <rippls@woodlandschools.org> > >Subject: [Puppet-users] computer groups > >To: puppet-users@madstop.com > > > > Hi, > > > > Forgive the newbie questions but I''m just starting > > out here in puppet land... > > > > In site.pp can I define ''groups'' of computers and > > then apply classes to those groups, rather than > > machine by machine? So I have my Debian group and > > they get their "policies" (yes, I''m coming from > > managing AD servers!), my Ubuntu group, my > > mailservers group etc etc, so I can apply both group > > and individual settings to any machine. > > > > And speaking of Debian/Ubuntu... I see puppet can > > differentiate between os''es, can it distinguish > > different distributions in the same way. I''d like a > > single sources.list policy and to have the file > > uploaded depend on the flavour of Linux. > > > > Thanks, > > Steve Rippl > > Woodland School District > >________________ > >_______________________________________________ > >Puppet-users mailing list > >Puppet-users@madstop.com > >https://mail.madstop.com/mailman/listinfo/puppet-users