[chef] Re: Node or Role Attribute reference via Chef::Resource::Script::Bash


Chronological Thread 
  • From: "Julian C. Dunn" < >
  • To: " " < >
  • Subject: [chef] Re: Node or Role Attribute reference via Chef::Resource::Script::Bash
  • Date: Fri, 30 May 2014 18:23:08 -0400

Sure, does something like this not work?

$ chef-apply -s
execute 'echo hi' do
  only_if { node['hostname'] == 'foobar' }
end
Recipe: (chef-apply cookbook)::(chef-apply recipe)
  * execute[echo hi] action run (skipped due to only_if)


- Julian

On Fri, May 30, 2014 at 3:24 PM, David Chait 
< >
 wrote:
> All,
>      I apologize if this is a rather basic question, but I cannot seem
> to find a clear answer. I am trying to pull a node or role based
> attribute into only_if or not_if logic within a Bash block, though so
> far without a lot of luck. A> Is it possible? B> If so, how?
>
> Thanks,
> David



-- 
[ Julian C. Dunn 
< >
          * Sorry, I'm    ]
[ WWW: http://www.aquezada.com/staff/julian    * only Web 1.0  ;]
gopher://sdf.org/1/users/keymaker/           * compliant!    ;]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9       ]



Archive powered by MHonArc 2.6.16.

§