This module manages /etc/hosts
from a template. You can also use it to add host entries.
- host_ip
- host_name
- host_fqdn - the host's fully qualified domain name
- hosts_entries - a list of hosts entries as shown below
Replace /etc/hosts
with the template file
include hosts
Replace /etc/hosts
with the template file, configured with parameters
class { 'hosts':
host_ip => '192.168.170.120',
host_name => 'myserver',
host_fqdn => 'myserver.mydomain.com',
hosts_entries => [
"192.168.170.169 anotherdomain.com",
"192.168.170.170 exampledomain.com"
]
}
Thanks to Dennis Hoppe for several ideas extracted from his own Hosts Puppet module.
This Puppet module is released under the MIT license: