L.A.Hurst@lboro.ac.uk
2008-Feb-12 09:55 UTC
Best practice for managing two versions of same configuration file.
Hi, I have two different versions of /etc/puppet/puppet.conf, which I would like to manage through puppet. One version is for the puppetmaster (and has the puppetmasterd section) and the other does not. In order not to advertise the database password (for storeconfig) to all and sundry it is necessary to not have the puppetmasterd section on all of the clients. However puppet will not let me have puppet::master and puppet::client classes both managing the same file (even if no node has both classes). What is the best practice for managing this scenario? Many Thanks -Laurence Hurst
Peter Hoeg
2008-Feb-12 11:01 UTC
Re: Best practice for managing two versions of same configuration file.
Inheritance. I have a puppet::base, puppet::client (inheriting base) and puppet::server (inheriting client). You define the file in the client class like this: class puppet::client inherits puppet::base { file { "/etc/puppet/puppetd.conf": source => "puppet://$server/puppet/client/puppetd.conf"; } } and then override it in the server class: class puppet::server inherits puppet::client { File["/etc/puppet/puppetd.conf"] { source => "puppet://$server/puppet/server/puppetd.conf" } } On 12/02/2008, L.A.Hurst@lboro.ac.uk <L.A.Hurst@lboro.ac.uk> wrote:> Hi, > I have two different versions of /etc/puppet/puppet.conf, which I would like to manage through puppet. One version is for the puppetmaster (and has the puppetmasterd section) and the other does not. In order not to advertise the database password (for storeconfig) to all and sundry it is necessary to not have the puppetmasterd section on all of the clients. However puppet will not let me have puppet::master and puppet::client classes both managing the same file (even if no node has both classes). > > What is the best practice for managing this scenario? > Many Thanks > -Laurence Hurst > > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >-- /peter
L.A.Hurst@lboro.ac.uk
2008-Feb-12 11:17 UTC
Re: Best practice for managing two versions of same configuration file.
Interesting, you have used a different syntax to define the file in the 2nd level (`File["foo"]` vs `file { "foo:"`) - is this syntax discussed anywhere? I have not seen it on the wiki. I was trying to use the `file { "foo:` syntax again for the server, which caused it to fall over. -Laurence> -----Original Message----- > From: puppet-users-bounces@madstop.com > [mailto:puppet-users-bounces@madstop.com] On Behalf Of Peter Hoeg > Sent: 12 February 2008 11:02 > To: Puppet User Discussion > Subject: Re: [Puppet-users] Best practice for managing two > versions of same configuration file. > > Inheritance. > > I have a puppet::base, puppet::client (inheriting base) and > puppet::server (inheriting client). > > You define the file in the client class like this: > > class puppet::client inherits puppet::base { > file { > "/etc/puppet/puppetd.conf": > source => "puppet://$server/puppet/client/puppetd.conf"; > } > } > > and then override it in the server class: > > class puppet::server inherits puppet::client { > File["/etc/puppet/puppetd.conf"] { > source => "puppet://$server/puppet/server/puppetd.conf" } > } > > On 12/02/2008, L.A.Hurst@lboro.ac.uk <L.A.Hurst@lboro.ac.uk> wrote: > > Hi, > > I have two different versions of /etc/puppet/puppet.conf, > which I would like to manage through puppet. One version is > for the puppetmaster (and has the puppetmasterd section) and > the other does not. In order not to advertise the database > password (for storeconfig) to all and sundry it is necessary > to not have the puppetmasterd section on all of the clients. > However puppet will not let me have puppet::master and > puppet::client classes both managing the same file (even if > no node has both classes). > > > > What is the best practice for managing this scenario? > > Many Thanks > > -Laurence Hurst > > > > > > > > _______________________________________________ > > Puppet-users mailing list > > Puppet-users@madstop.com > > https://mail.madstop.com/mailman/listinfo/puppet-users > > > > > -- > /peter > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
L.A.Hurst@lboro.ac.uk
2008-Feb-12 12:13 UTC
Re: Best practice for managing two versions of same configuration file.
> -----Original Message----- > From: puppet-users-bounces@madstop.com > [mailto:puppet-users-bounces@madstop.com] On Behalf Of > L.A.Hurst@lboro.ac.uk > Sent: 12 February 2008 11:18 > To: Puppet User Discussion > Subject: Re: [Puppet-users] Best practice for managing two > versions of same configuration file. > > > Interesting, you have used a different syntax to define the > file in the 2nd level (`File["foo"]` vs `file { "foo:"`) - is > this syntax discussed anywhere?You can ignore that - I''ve found where it''s discussed in the LanguageTutoial :) Thanks for the advice -Laurence