[chef] Re: Chef server name attribute?


Chronological Thread 
  • From: Seth Chisamore < >
  • To:
  • Subject: [chef] Re: Chef server name attribute?
  • Date: Thu, 26 Jan 2012 06:31:06 -0800

Randy,
You should be able to to grab it from the Chef::Config object

# Warning: This file is managed by the Chef server <%= Chef::Config[:chef_server_url] %> on node <%= node['fqdn'] %>!

Take a look at the chef-client and pxe_dust cookbooks for more example usage:
https://github.com/opscode/cookbooks/blob/master/chef-client/templates/default/client.rb.erb#L4-6
https://github.com/opscode/cookbooks/blob/master/pxe_dust/templates/default/chef-bootstrap.sh.erb#L19

-- 
Seth Chisamore
Software Design Engineer, Opscode, Inc.
IRC, Skype, Twitter, Github: schisamo

On Thursday, January 26, 2012 at 6:14 AM, Van Fossan,Randy wrote:

Fellow Chef's:

Is there any attribute that contains the chef server fqdn on the client node? I would like to add it into the template so that humans would know which chef server is managing that node. I know they could look in the /etc/chef/client.rb , but, it would be nice to use something like the following:

# Warning: This file is managed by the Chef server <% node['chefserver'] %> on node <%= node['fqdn'] %>!

I also know I could code for it, but I am looking for the best way so as to keep the chef runs as efficient as possible.

Thanks,
Randy




Archive powered by MHonArc 2.6.16.

§