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?
Archive powered by MHonArc 2.6.16.