It shouldn't, according to the README .md, " If the attribute node['machine_fqdn'] is set, it will use the string found there to attempt to configuration the machine's hostname." It's a new option in the latest production code. It's also a violation of the coding standards where attributes should be associated with their particular cookbook. Ideally, the attribute would be "node['fqdn']['machine_fqdn']".
As it stands, specifying that attribute on a host by host basis is not very practical. It means that each host would need its own role or environment to have the FQDN applied reliably.
--
Nico Kadel-Garcia
Senior Systems Consultant
Email: nkadelgarcia-consultant@scholastic.com
Cell Phone: +1.339.368.2428
-----Original Message-----
From: Daniel DeLeo [mailto:ddeleo@kallistec.com] On Behalf Of Daniel DeLeo
Sent: Thursday, May 29, 2014 5:05 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: RE: fqdn and Chef Server
Looks like the cookbook expects you to set the node[‘machine_fqdn]
attribute.
--
Daniel DeLeo
On Thursday, May 29, 2014 at 2:02 PM, Kadel-Garcia, Nico wrote:
I'm afraid that the latest fqdn cookbook is bombing out on my CentOS 6 test environment as follows, so I really can't recommend it until this sort of problemis resolved.
--
Nico Kadel-Garcia
Senior Systems Consultant
Email: nkadelgarcia-consultant@scholastic.com
(mailto:nkadelgarcia-consultant@scholastic.com)
Cell Phone: +1.339.368.2428
Starting Chef Client, version 11.12.4
resolving cookbooks for run list: ["fqdn"] Synchronizing Cookbooks:
- now
- hostsfile
- line
- fqdn
Compiling Cookbooks...
======================================================================
========== Recipe Compile Error in
/var/cache/chef/cookbooks/fqdn/recipes/default.rb
==========
ArgumentError
node['machine_fqdn'] must be set
Cookbook Trace:
/var/cache/chef/cookbooks/fqdn/libraries/machine_fqdn.rb:17:in sanity_check' /var/cache/chef/cookbooks/fqdn/libraries/machine_fqdn.rb:10:in
initialize'
/var/cache/chef/cookbooks/fqdn/recipes/_rhel.rb:21:in new' /var/cache/chef/cookbooks/fqdn/recipes/_rhel.rb:21:in
from_file'
/var/cache/chef/cookbooks/now/libraries/default.rb:23:in include_recipe_now' /var/cache/chef/cookbooks/fqdn/recipes/default.rb:27:in
from_file'
Relevant File Content:
/var/cache/chef/cookbooks/fqdn/libraries/machine_fqdn.rb:
10: sanity_check node
11: set_attributes node
12: end
13:
14: private
15:
16: def sanity_check(node)
17>> fail ArgumentError, "node['machine_fqdn'] must be set" if node['machine_fqdn'].nil?
18: dots = node['machine_fqdn'].split('.').count - 1
19: fail ArgumentError, 'There must be least one dot in an FQDN' if
dots < 1
20: end
21:
22: def set_attributes(node)
23: @fqdn = node['machine_fqdn']
24: head, *tail = node['machine_fqdn'].split('.')
25:
26: if node['machine_fqdn_as_hostname']
Running handlers:
Running handlers complete