- From: Joshua Timberman <
>
- To:
- Subject: [chef] Re: stop service / config file change / start service
- Date: Thu, 14 Jul 2011 23:26:58 -0700
Hello!
On Thu, Jul 14, 2011 at 12:22 PM, Steven Parkes
<
>
wrote:
>
Sorry if this is covered elsewhere, but I'm wondering if there is/shouldn't
>
be a way to stop a service before making config file changes, rather than
>
restarting afterwards.
>
>
An example is networking: I want to stop it using the old config and then
>
start it with the new config. Otherwise, it gets confused because the
>
number of interfaces may have changed. Doing a stop with the new config
>
file is not the same thing as doing a stop with the old config.
>
>
Unless there's another/better way to do this ...
Sure, you can reuse the same named resource and send it multiple
actions. You'll want a conditional that wraps the recipe so it doesn't
occur (stop networking) unless necessary). For example, we do this in
the mysql::server_ec2 recipe to move the data directory of MySQL to
ephemeral storage (or an EBS volume depending on the attribute
setting)
*
https://github.com/opscode/cookbooks/blob/master/mysql/recipes/server_ec2.rb
Though for networking I'd want to be very careful about how this is
handled as it may be ...problematic if there's an error.
--
Opscode, Inc
Joshua Timberman, Director of Training and Services
IRC, Skype, Twitter, Github: jtimberman
Archive powered by MHonArc 2.6.16.