Chef server name attribute?

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

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

Thanks Seth… Where did you find the information on the Chef::Config object ?? I am still a newbie on chef… :O)

I need to parse that URL to just the fqdn.

From: Seth Chisamore [mailto:schisamo@opscode.com]
Sent: Thursday, January 26, 2012 9:31 AM
To: chef@lists.opscode.com
Subject: [chef] Re: Chef server name attribute?

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

The best place to start is the 'Chef Configuration Settings' wiki page:
http://wiki.opscode.com/display/chef/Chef+Configuration+Settings

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

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

Thanks Seth.. Where did you find the information on the Chef::Config object ?? I am still a newbie on chef.. :O)

I need to parse that URL to just the fqdn.

From: Seth Chisamore [mailto:schisamo@opscode.com]
Sent: Thursday, January 26, 2012 9:31 AM
To: chef@lists.opscode.com (mailto:chef@lists.opscode.com)
Subject: [chef] Re: Chef server name attribute?

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