- From: Xabier de Zuazo <
>
- To:
- Subject: [chef] Re: Re: Re: Re: notifies :before
- Date: Fri, 22 Nov 2013 20:22:40 +0100
- Organization: Onddo Labs SL
Hello guys,
On Thu, 21 Nov 2013 09:22:33 -0800
Daniel DeLeo
<
>
wrote:
>
> Thank you for your reply. I understand how notifies work, I was
>
> just wondering if there was an elegant way to notify resources
>
> _before_ running current resource. I know you could do it with
>
> chaining resources through notify, but that smells a bit.
>
> I found an issue asking the same question:
>
> https://tickets.opscode.com/browse/CHEF-2421
>
>
>
>
>
>
This would certainly be useful. The canonical use case is if you’re
>
managing a service that needs to be stopped before it’s upgraded,
>
which is common for some kinds of web app.
>
>
Unfortunately, the way most Chef providers are written now, there’s
>
no reasonable way to implement this as a before notification. One
>
possible avenue we haven’t explored yet is to run an individual
>
resource in why-run mode to see if it would make a change, which
>
might look like this in the DSL:
>
>
service “my-web-app” do
>
action :stop
>
# means “only if the resource deploy[my-web-app] would make
>
changes when running the :deploy action" test_resource
>
“deploy[my-web-app]”, :deploy end
>
>
The implementation would still be pretty complicated, but much less
>
so than the things we’ve tried before. Someone outside of opscode
>
would need to take this on because I don’t think we can fit it in our
>
priorities for quite a while.
I'm the one who tried to implement this a year ago. I proposed a
solution for the :before in this comment:
https://tickets.opscode.com/browse/CHEF-2421?focusedCommentId=29465&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-29465
This solution included why-run support. In fact, it was easier for me
to implement this with why-run than without it.
After this solution was proposed, I know you talked a lot about it and
whether to add this feature to Chef or not. Even you asked on this
list. Much time was spent on this.
Time passed and the issue was finally closed putting it to "Won't
fix" state. But I didn't received any feedback about my code and I
didn't know how to improve it or what was the way forward.
The point is: Do you think it is a good idea to attempt to rebase this
solution and make a new PR or that would not help?
Bye,
--
Xabier de Zuazo Oteiza
IT System Administrator - Onddo Labs S.L.
www.onddo.com
--------------------------------------------------------------------
Public Key =
http://www.onddo.com/xabier_zuazo.pub
Key Fingerprint = 8EFA 5B17 7275 5F1F 42B2 26B4 8E18 8B67 9DE1 9468
--------------------------------------------------------------------
Attachment:
signature.asc
Description: PGP signature
Archive powered by MHonArc 2.6.16.