Is there any way to have puppet push an initial configuration file, and then let local admins modify it without it being overwritten by subsequent puppet runs ? Two examples: Push-if-not-existing: ----------------------------- I want to push a default /etc/httpd/conf.d/00-local-defaults.conf , but would like to allow the local webmaster to change it if he needs to override some defaults here. Push-if-default (maybe based on checksum) ---------------------------------------------------------------- When installing mysql, I want to overwrite the RPM-supplied /etc/ my.cnf with our default, and still let the local mysql-admin to override the defaults here. -- 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.
-- 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.
Zitat von janfrode <janfrode@tanso.net>:> Is there any way to have puppet push an initial configuration file, > and then let local admins modify it without it being overwritten by > subsequent puppet runs ?have a look at the replace option of the file resource: http://docs.reductivelabs.com/references/stable/type.html#file> Two examples: > > Push-if-not-existing: > ----------------------------- > I want to push a default /etc/httpd/conf.d/00-local-defaults.conf , > but would like to allow the local webmaster to change it if he needs > to override some defaults here.this one is straightforward using the above parameter.> Push-if-default (maybe based on checksum) > ---------------------------------------------------------------- > When installing mysql, I want to overwrite the RPM-supplied /etc/ > my.cnf with our default, and still let the local mysql-admin to > override the defaults here.this one might be solved by deploying your default config file _before_ installing the package, hence rpm will not touch your already deployed config file and deploy its config file with the .rpmsave extension. But to detect on a machine with the package already installed wheter the file should be deployed or not might get tricky. You could use and exec in front of the file resource to determine whether the config file have been altered from the one shipped by the package by using the rpm command, if not, delete it and puppet will deploy its default for you. However this only works if your default is not the same as the one shipped with the package. cheers pete ps: sorry for the empty mails. I hope to have that flaw finally fixed in my mailer. -- 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.
On Sun, 14 Mar 2010 19:11:26 +0100 Peter Meier <peter.meier@immerda.ch> wrote:> have a look at the replace option of the file resource: > http://docs.reductivelabs.com/references/stable/type.html#fileI''ve done similar things with custom facts sent from the client at system build time. i.e. during the initial puppet run in the kickstart %post, I''ll export FACTER_BUILDING=true and then test for that fact in the manifests. If it''s present, it''ll overwrite the file, otherwise it''ll just leave it be. It''s not elegant, but it works :) Cheers, Jon -- Jon Fautley RHCE, RHCDS, RHCX, RHCA email: jfautley@redhat.com Senior Consultant cell : +44 7841 558683 Global Professional Services Red Hat UK, 200 Fowler Avenue, Farnborough, Hampshire, GU14 7JP