[chef] Re: Re: Re: pre-update notifications


Chronological Thread 
  • From: Ranjib Dey < >
  • To:
  • Subject: [chef] Re: Re: Re: pre-update notifications
  • Date: Thu, 22 Aug 2013 07:58:11 -0700

Chef does not provide anything like before resource update notification. you have post update even handler hooks and standard notification/subscription via dsl.might be able to get close to what you want by doing a why_run first and then dynamically changing the action of notified resource, but this wont be very straightforward, also you have to ensure the why_run implementations are correct.


On Thu, Aug 22, 2013 at 7:52 AM, Grégoire Seux < " target="_blank"> > wrote:
Le 22/08/2013 16:17, Andrew Gross a écrit :


execute "Update Cassandra" do
  notifies :run, execute[Downtime Cassandra Host],
end

execute "Downtime Cassandra Host" do
  action :nothing
  notifies :restart, service[Cassandra],
end

service "Cassandra" do
  action :nothing
end
Hi Andrew,

thanks for your reply.
This issue with your solution is that it assumes that you can update the package and then decide to restart the service.
In my case, the package contains triggers to update restart the service (stop it as pre-install and start as post-install hook). This pattern is quite commom I guess on rhel and debian systems.

So in your example you would have updated the package (thus restart the service), downtimed the host and restart the service once more.

--
Gregoire




Archive powered by MHonArc 2.6.16.

§