- From: Joshua Timberman <
>
- To: "<
>" <
>
- Subject: [chef] Re: delayed execution order error?
- Date: Thu, 21 Feb 2013 20:34:34 +0000
- Accept-language: en-US
You should use the updated notification syntax for notifies:
notifies :restart, "service[foo]"
Instead of this:
notifies :restart, resources(:service => "foo") # or...
notifies :restart, resources("service[foo]")
The #resources() method here does a lookup of all the resources in the
resource collection for the one named in order to set the notification, and
it evaluates during the resource collection compilation phase. This is why
you had to declare a resource with action :nothing prior to notifying it.
Note that the subscribes parameter requires the latter style using the
#resources() method.
On Feb 21, 2013, at 10:17 AM, Tensibai
<
>
wrote:
>
Hum.. I remember having to define services with action :nothing to be able
>
to notify them.
>
>
I'm quite sure you have an action :restart inside the service declaration.
>
Fot what I understand, the service is define to restart, it does restart
>
and ignore any notification as it has already do what it was suppose to do
>
(restart).
>
>
Set action to nothing in your service and notifications for restart will be
>
ok I think.
>
--
Joshua Timberman
Technical Community Manager, Opscode, Inc
IRC, Skype, Twitter, Github: jtimberman
Archive powered by MHonArc 2.6.16.