cookbook 'hostnames', '~> 0.4.2'
hostnames (9) Versions 0.4.2 Follow9
Configures hostname and FQDN
cookbook 'hostnames', '~> 0.4.2', :supermarket
knife supermarket install hostnames
knife supermarket download hostnames
hostnames cookbook
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
Install it
With berkshelf - Berskfile
source 'https://supermarket.getchef.com' ... cookbook 'hostnames'
Example
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 }, ... )
Attributes
-
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
)
Recipes
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"]
.
Contributing
Fork.
Make more awesome.
Pull request.
I will bump version and run:
knife cookbook site share hostnames "Networking" -o ../ -u nt -k ~/.ssh/chef-nt.pem -VV
Author
(original) Maciej Pasternacki maciej@3ofcoins.net
(current) Nathan nathan@vertile.com
Dependent cookbooks
hostsfile >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Change History
0.4.0
- #1: for fqdns on 127.0.0.1, write localhost after the fqdn record (https://github.com/kevit)
- #2: substitute underscores in hostnames to support chef node names w/ underscores (https://github.com/joshsmoore)
- #5: centos 7 support with hostnamectl (https://github.com/gene1wood)
- 0.4.1: exclude hostnamectl from amazon distro
0.3.0
- #27: Update default recipe to reload only the hostname plugin instead of ohai (Jonathan Serafini)
- Fixed (and tested) FreeBSD support
- #17: added support for RedHat & CentOS (Damien Roche, Marta Paciorkowska)
- added instructions on manual testing with reboot (Marta Paciorkowska)
0.2.0
- Refresh and fix tests, add Rubocop style checks (Marta Paciorkowska)
- #16: do not remove existing /etc/hosts entries on 127.0.0.1, use configurable IP for hostname entry we need to have for ourselves (Jean Mertz, Marta Paciorkowska)
0.1.0
- Tests: chefspec, test-kitchen
- Substitute
*
inset_fqdn
withnode.name
to allow fully automatic FQDN setup.
0.0.6
- Clean up backup files from community.opscode.com release
0.0.5
- Added change log
-
metadata.rb
explicitly states cookbook name (Chulki Lee) - New recipe
hostname::vmware
(tily) - Use hostsfile cookbook to manipulate
/etc/hosts
, use 127.0.1.1 instead of trying to figure out own IP (Guilhem Lettron)
0.0.4
- Use attribute levels when setting for Chef 11 compatibility (Alan Wilhelm)
0.0.3
- Syntax fix for compatibility with Ruby 1.9.2
0.0.2 and before
This is prehistory.
Collaborator Number Metric
0.4.2 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.4.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.4.2 failed this metric
FC007: Ensure recipe dependencies are reflected in cookbook metadata: hostnames/recipes/vmware.rb:36
FC064: Ensure issues_url is set in metadata: hostnames/metadata.rb:1
FC065: Ensure source_url is set in metadata: hostnames/metadata.rb:1
FC066: Ensure chef_version is set in metadata: hostnames/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.4.2 passed this metric
Testing File Metric
0.4.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.4.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.4.2 failed this metric
0.4.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.4.2 failed this metric
FC007: Ensure recipe dependencies are reflected in cookbook metadata: hostnames/recipes/vmware.rb:36
FC064: Ensure issues_url is set in metadata: hostnames/metadata.rb:1
FC065: Ensure source_url is set in metadata: hostnames/metadata.rb:1
FC066: Ensure chef_version is set in metadata: hostnames/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.4.2 passed this metric
Testing File Metric
0.4.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.4.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.4.2 failed this metric
FC064: Ensure issues_url is set in metadata: hostnames/metadata.rb:1
FC065: Ensure source_url is set in metadata: hostnames/metadata.rb:1
FC066: Ensure chef_version is set in metadata: hostnames/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.4.2 passed this metric
Testing File Metric
0.4.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.4.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.4.2 failed this metric
0.4.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number