Reputation: 1204
When we work with template chef resource, then <%= node["fqdn"] %>
will modify with node's fqdn. I want to do this using file resource. I have a file abc.txt
and <%= node["fqdn"] %>
or any other variable inside it.
How to change this variable with actual value when chef-client runs.
This is my file resource -->
file "/home/user/test.txt" do
content IO.read("/opt/cheftest/abc.txt")
mode '0755'
action :create
end
Above copies content of abc.txt in test.txt as it is without changing variable name with actual values. How to change variables with actual values ?
Upvotes: 0
Views: 978
Reputation: 54249
I think what you are asking for is the local
property on the template
resource, but it is hard to tell. Normally you would just use a plain old template
resource unless you have a really good reason.
Upvotes: 2