I'm trying to set a config file on my server at bootstrap to the value of the Chef node name. Here's my code:
log "Node name: #{Chef::Config[:node_name]}"
template "/etc/sysconfig/network" do
owner "root"
group "root"
mode 00644
source "network.erb"
variables(
:myhostname => Chef::Config[:node_name]
)
end
network.erb:
NOZEROCONF=true
HOSTNAME=<%= myhostname %>
NETWORKING=yes
The node name is logged correctly from Chef::Config but when I try to set the value in my template I'm getting this error:
undefined local variable or method `myhostname' for #<Chef::Mixin::Template::TemplateContext:0x00...
How can I set the value in the template to the node's node?
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 175
تاريخ: سه
شنبه
18 خرداد
1395 ساعت: 0:57