- From: ItsMikeE <
>
- To:
- Subject: [chef] How do I test an attribute value in an "only_if" test?
- Date: Fri, 24 Jun 2011 02:04:19 -0700 (PDT)
I have two possible values of a variable, the default attribute and one
overridden in a role.
In my recipe I would like to test the value of the variable
Code is of the format
cookbook_file "/dir/file" do
action :create
source "default file"
owner "root"
group "root"
mode 0644
only_if "test [:filetype]="default""
end
cookbook_file "/dir/file" do
action :create
source "other file"
owner "root"
group "root"
mode 0644
only_if "test [:filetype]="other""
end
The only_if test is not working (syntax error).
Is there a way to do this kind of check?
- [chef] How do I test an attribute value in an "only_if" test?, ItsMikeE, 06/24/2011
Archive powered by MHonArc 2.6.16.