- From: John Alberts <
>
- To:
- Subject: [chef] Re: Re: apply a role's attributes by name?
- Date: Mon, 6 Aug 2012 09:58:58 -0500
Thanks, but unfortunately, that doesn't seem to work. I don't get any
kind of error, but the remaining chef code doesn't seem to pick up the
new attributes in the new role that was added. Any other ideas? :)
John
On Thu, Aug 2, 2012 at 5:12 PM, Daniel DeLeo
<
>
wrote:
>
>
>
On Thursday, August 2, 2012 at 3:03 PM, John Alberts wrote:
>
>
> Is there any way to apply any role's attributes during a chef run? The
>
> reason I need to do this is because I am adding a role to the run_list
>
> during a chef run and I'd like that role's attributes to take effect
>
> during the current chef run. I know this is not idempotent and I
>
> shouldn't be doing things this way, but let's not get into that
>
> discussion today. :)
>
>
>
> This is what I'm hoping I can do:
>
>
>
> node['run_list'] << "role[roleA]"
>
> role.apply("roleA") # now the attributes in roleA will be available
>
> for the rest of the chef run.
>
>
>
>
>
> Thanks in advance.
>
> John
>
>
I think `node.expand!` after adding the role should do the trick.
>
>
--
>
Dan DeLeo
>
>
>
--
John Alberts
Archive powered by MHonArc 2.6.16.