[chef] Re: Re: Re: Question - only if your configuration files are changed


Chronological Thread 
  • From: Matthew Moretti < >
  • To:
  • Subject: [chef] Re: Re: Re: Question - only if your configuration files are changed
  • Date: Thu, 7 Feb 2013 08:50:48 -0500

Yes, the link Mike gave is exactly how you achieve this.

Resources only "notify" when they needed to do something to get your system into the state that they describe.  So, in this example IF "/etc/ntp.conf" is modified by Chef, then it will notify the ntp service resource to perform its "restart" action.

More information on notifications here: http://docs.opscode.com/chef/resources.html#notifications

-Matt Moretti


On Thu, Feb 7, 2013 at 8:33 AM, Spike Grobstein < " target="_blank"> > wrote:
I've often wondered this myself. I currently keep one backup of the config and restart only if the current and the backup differ, but its incredibly hacky and doesn't work if you put a "configured by chef" time stamp at the top.

It doesn't appear that that recipe only restarts if the file is changed. Or am I missing something?



...spike
(Sent via handheld, please pardon spelling errors)

On Feb 7, 2013, at 8:18 AM, Mike < "> > wrote:

> See here, from the opsocde ntp cookbook:
> https://github.com/opscode-cookbooks/ntp/blob/master/recipes/default.rb#L44-L50
>
> On Thu, Feb 7, 2013 at 6:50 AM, Alex Vitola < "> > wrote:
>> How do I restarting a service only if your configuration files are changed
>>
>>
>> Example: ntp service




Archive powered by MHonArc 2.6.16.

§