Hi All, I am new to Puppet and recently switched from Cfengine. I used it to make to propagate a configuration file. The manifest involved wgetting a file and restarting the concerned daemon. As a result of this within a couple of hours I got flooded with alerts because the daemon kept restarting. I am aware that by default puppet runs the manifest every 30mins and that value is adjustable but I want it to run only when the manifest has changed, like in cfengine. Sameer --~--~---------~--~----~------------~-------~--~----~ 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
2009-Aug-24 14:49 UTC
[Puppet Users] Re: Running puppet on manifest modificattion
Is there any reason for specifically using wget and not the file resource. You usually use the service and file resources for what you do... Something like this example here for nginx http://github.com/lak/puppet-nginx/tree/master (look in both init.pp and config.pp). Stripping down should look like: class nginx { package { nginx: ensure => installed } service { nginx: ensure => running, enable => true } file { "/etc/nginx/nginx.conf": content => template("nginx/nginx.conf.erb"), mode => 644, owner => root, notify => Service[nginx] } } Also do some requires for the package (ie make sure the package is installed before copying the file or checking if the service is running) Silviu sameer wrote:> Hi All, > > I am new to Puppet and recently switched from Cfengine. I used it to > make to propagate a configuration file. The manifest involved wgetting > a file and restarting the concerned daemon. As a result of this within > a couple of hours I got flooded with alerts because the daemon kept > restarting. > > I am aware that by default puppet runs the manifest every 30mins and > that value is adjustable but I want it to run only when the manifest > has changed, like in cfengine. > > Sameer > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Michael Gliwinski
2009-Aug-24 15:11 UTC
[Puppet Users] Re: Running puppet on manifest modificattion
On Monday 24 August 2009 11:35:01 sameer wrote:> Hi All, > > I am new to Puppet and recently switched from Cfengine. I used it to > make to propagate a configuration file. The manifest involved wgetting > a file and restarting the concerned daemon. As a result of this within > a couple of hours I got flooded with alerts because the daemon kept > restarting.That depends on how are you doing this in puppet. If you''re using ''wget'' in exec resource then indeed that''s what will happen (see below). The proper way would be to use file and service resources: file { ''/etc/daemon_config_file'': ensure => present, # ... owner, group, mode, etc. source => ''puppet:///.../daemon_config_file'', notify => Service[''daemon''], } service { ''daemon'': ensure => running } The ''notify'' metaparam will cause the service to be restarted only if file has changed.> > I am aware that by default puppet runs the manifest every 30mins and > that value is adjustable but I want it to run only when the manifest > has changed, like in cfengine.While puppet indeed runs every 30 mins by default, it only applies changes if there''s actually something to apply. Which means the configuration has to be idempotent so puppet can tell if a change has to be applied or not. Most resources handle that by default, in case of exec resources you have to do it by hand, e.g. by specifying one of ''onlyif'', ''unless'', ''creates'', etc. metaparams. Have a look at type reference here: http://reductivelabs.com/trac/puppet/wiki/TypeReference> > Sameer > >-- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ********************************************************************************************** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify support@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 ********************************************************************************* --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---