cookbook 'set-hostname', '= 1.1.0'
set-hostname (4) Versions 1.1.0 Follow1
Sets the hostname on a node and updates the hosts file.
cookbook 'set-hostname', '= 1.1.0', :supermarket
knife supermarket install set-hostname
knife supermarket download set-hostname
Set Hostname
This simple cookbook sets the hostname on a given host using the node.name
as the default name, and appending any domain, if provided, for the fully qualified domain name of the host.
It also populates the file /etc/hosts
file.
Attributes
You can set the following attributes:
node.normal['set-hostname']['domain'] = 'bar.com'
The following attributes are inferred automaticaly, but can also be overridden by the user:
default['set-hostname']['hosts-file'] = '/etc/hosts' default['set-hostname']['name'] = node.name default['set-hostname']['ip'] = node['ipaddress']
For a node with the name foo001
, the above configuration will result in the hostname set to foo.bar.com
and the IP address in the /etc/hosts
file will be 1.2.3.4
.
Default Attributes
The cookbook only requires that you set the domain portion of the name.
In that case, the actual hostname portion is inferred from the node.name
, and the IP address is taken from node['ipaddress']
unless provided specifically by the node['set-hostname']['ip]
attribute.
If you do not provide the domain name, the host is configured without the FQDN.
Contributing
To contribute, please fork the cookbook and submit a pull request.
License
MIT License, full text is in the [LICENSE.md](LICENSE.md) file.
Authors
- Konstantin Gredeskoul (current maintainer)
- Eric Saxby
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
1.1.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.1.0 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
1.1.0 passed this metric
No Binaries Metric
1.1.0 passed this metric
Testing File Metric
1.1.0 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
1.1.0 passed this metric
1.1.0 failed this metric
1.1.0 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
1.1.0 passed this metric
No Binaries Metric
1.1.0 passed this metric
Testing File Metric
1.1.0 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
1.1.0 passed this metric
1.1.0 passed this metric
1.1.0 passed this metric
Testing File Metric
1.1.0 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
1.1.0 passed this metric
1.1.0 failed this metric
1.1.0 passed this metric