Thanks !!
:)
On Monday, September 16, 2013 4:12:44 PM UTC+2, jcbollinger wrote:
>
>
>
> On Monday, September 16, 2013 7:40:35 AM UTC-5, Adeel Bhatti wrote:
>>
>> Thanks for your reply !
>> This would be really cool if the agent can look and identify the manifect
>> changes !
>> I have a service restart in my class, so I want to execute that only if
>> there is some change in the configuration/manifest !
>> Regards
>> Adeel
>>
>>
>
> Puppet can do that. See below.
>
> In answer to your original question, it is usual for each Puppet client to
> run the agent on a regular schedule, either using its built-in daemon mode
> (i.e. running it as a service) or via an external scheduler, such as cron.
> That way there is no need to touch individual clients to roll out
> configuration changes -- it is sufficient to change the manifests and/or
> data on the master.
>
> It is important to understand that Puppet is a state management service,
> not a script engine. The distinction shows up here in that the Puppet
> agent's normal behavior is to check the properties of each managed
> resource, and to apply only those changes needed to put it into the target
> state. Resources that are already in the target state are not changed in
> any way.
>
> Thus, whenever the agent modifies a resource, such as a service's
> configuration file, it constitutes a genuine change. Puppet has a
> mechanism for notifying resources about such changes in other resources,
> and it is particularly well supported for exactly the situation you
> describe: restarting services when their configuration changes. It can
> look like this:
>
> file { '/etc/myservice.conf':
> ensure => 'file',
> content => template('myservice.conf.tmpl'),
> # ...
> }
>
> service { 'myservice':
> enable => true,
> ensure => running,
> subscribe => File['/etc/myservice.conf']
> }
>
> The magic is in the 'subscribe' parameter. It says that the service needs
> to be "refreshed" if the agent applies any changes to the referenced file
> resource. The meaning of "refresh" varies by resource type, but for
> services it means to restart the service.
>
>
> John
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.