- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: apply a role's attributes by name?
- Date: Thu, 2 Aug 2012 15:12:15 -0700
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
Archive powered by MHonArc 2.6.16.