Where i can find chef server ip and hostname in a recipe for add variable to template
For example i have a recipe:
# Creating true /etc/hosts
template "/etc/hosts" do
mode 0644
owner "root"
group "root"
source "etc/hosts.erb"
variables ({
:ip => node[:dc][:ip],
:domain => node[:dns][:domain],
:hostname => node[:dc][:hostname],
:chefserverip => ???????????????,
:chefserverhostname => ???????????????
})
action :create
end
and template:
127.0.0.1 localhost
<%= @chefserverip %> <%= @chefserverhostname %>.<%= @domain %>
<%= @ip %> <%= @hostname %>.<%= @domain %> <%= @hostname %>
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
How I can access service variables ??????????????? and ???????????????
And for a future:
How can i know what service vars are present when recipes are run? My be present a simple method or you hac a true doc url ?
Thank you very much.
-- Best regards, CVision Lab System Administrator Vladmir Skubriev
Archive powered by MHonArc 2.6.16.