- Overview
- Setup - The basics of getting started with etchosts
- Usage - Configuration options and additional functionality
Manage /etc/hosts.
The etchosts module lets you use Puppet to manage /etc/hosts
.
Note:
- Depends on
hostname
andfqdn
facter facts. - Only tested in Ubuntu.
/etc/hosts
Note: This module will replace your existing /etc/hosts
.
class { "etchosts": ensure => present }
class { "etchosts":
ensure => present,
add_ipv4_localhosts => true,
add_ipv6_localhosts => true,
hosts => {
192.168.1.10 => ['fred.example.com'],
192.168.1.11 => ['barney.example.com'],
}
template=> "mymodule/hosts.erb",
}
etchosts::ensure: "present"
etchosts::hosts:
192.168.10.1:
fred.example.com
fred
192.168.10.2:
barney.example.com