[chef] Re: pre-update notifications


Chronological Thread 
  • From: Andrew Gross < >
  • To: chef < >
  • Subject: [chef] Re: pre-update notifications
  • Date: Thu, 22 Aug 2013 10:17:00 -0400

Hey,

Our solution for this was to chain notifications in the order we wanted.  

For example:

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

The upside is that you have a relatively straightforward way to chain these processes, the downside is that this is entirely up to the coder to make sure they follow the pattern.

We do something similar with config validation before service restarts for Nginx.


On Thu, Aug 22, 2013 at 8:31 AM, Gregoire Seux < " target="_blank"> > wrote:
Hello,

I'd like to have pre-update notifications which would be the same as
"notifies" but triggered before resource convergence.

For instance, some packages automatically restart a service during
upgrade and I'd like to downtime the host in supervision _before_
actually starting to upgrade those packages.

Classic notifications would be :

>package "cassandra" do
>  notifies :run, "execute[downtime host]"
>end

but notification is triggered _after_ the upgrade so it is not useful
anymore.

I wondered how to do this and came up with a partial solution switching
to why_run  temporarily to find wether a given resource (package) will
be updated during convergence.
An example is https://gist.github.com/kamaradclimber/6306398
which would execute the resource to downtime only if the package will be
upgrade later.

Does anyone has already encountered such need? and fixed it?

--
Grégoire




Archive powered by MHonArc 2.6.16.

§