Easy hostname
, FQDN and /etc/hosts
file updates. Less broken than the hostname recipe.
Works with custom /etc/hosts
files and fixes aws dns slowness (use use_node_ip: true
)
https://github.com/nathantsoi/chef-cookbook-hostname
With berkshelf - Berskfile
source 'https://supermarket.getchef.com'
...
cookbook 'hostnames'
Run via a role - roles/base.rb
name 'base'
description 'Standard Sequoia setup'
run_list(
'recipe[hostnames::default]',
...
)
default_attributes(
set_fqdn: '*.sequoiacap.com',
hostname_cookbook: {
use_node_ip: true
},
...
)
node['set_fqdn']
- FQDN to set.
The asterisk character will be replaced with node.name
. This way,
you can add this to base role:
default_attributes :set_fqdn => '*.project-domain.com'
and have node set its FQDN and hostname based on its chef node name
(which is provided on chef-client
first run's command line).
-
node['hostname_cookbook']['use_node_ip']
-- when true sets the hostname tonode["ipaddress"]
in/etc/hosts
(default:false
) -
node['hostname_cookbook']['hostsfile_ip']
-- IP used in/etc/hosts
to correctly set FQDN (default:127.0.1.1
)
-
hostnames::default
-- will set node's FQDN to value ofset_fqdn
attribute, and hostname to its host part (up to first dot). -
hostnames::vmware
-- sets hostname automatically using vmtoolsd. You do not need to setnode["set_fqdn"]
.
-
Fork.
-
Make more awesome.
-
Pull request.
-
I will bump version and run (from batali):
batali knife cookbook site share hostnames "Networking" -o ../ -u nt -k ~/.ssh/chef-nt.pem -VV
(original) Maciej Pasternacki [email protected]
(current) Nathan [email protected]