- From: Chao <
>
- To:
- Subject: [chef-dev] forcing parameter to resource to be elevated at execute phase
- Date: Thu, 20 Dec 2012 09:40:00 -0800 (PST)
hi everyone,
i was wondering if variable passed as parameter to resource can be made to be
elevated at execute phase instead of compile phase. I have the following code
example.
ruby_block "Calculate secret" do
block do
node.set['secret_message'] = "This is a secret"
end
end
file "/tmp/test" do
content "#{node['secret_message']}"
mode 0644
end
This is a simplified version of the challenge i have, what i want is for the
file resource to use a variable node['secret_message'] which is computed by
the
ruby_block resource. but the end result is the file /tmp/test contains nothing
because #{node['secret_message']} being ruby code is elevated before the
ruby_block resource is run.
Does anyone know a solution? if there is a blog post somewhere let me know.
Thanks
- [chef-dev] forcing parameter to resource to be elevated at execute phase, Chao, 12/20/2012
Archive powered by MHonArc 2.6.16.