diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-04-12 17:09:03 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-04-12 17:09:03 -0300 |
commit | fe1c86b8f938283e9dd8196a8b11a9648f4b49e6 (patch) | |
tree | c2d999eca03862a3e4af57e0885397adf6bbc6ec /manifests/subsystem/hosts.pp | |
parent | ec5c750d12bdc7948bb3c04f0c72817718a0bf47 (diff) | |
download | puppet-nodo-fe1c86b8f938283e9dd8196a8b11a9648f4b49e6.tar.gz puppet-nodo-fe1c86b8f938283e9dd8196a8b11a9648f4b49e6.tar.bz2 |
Major refactor
Diffstat (limited to 'manifests/subsystem/hosts.pp')
-rw-r--r-- | manifests/subsystem/hosts.pp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/manifests/subsystem/hosts.pp b/manifests/subsystem/hosts.pp new file mode 100644 index 0000000..464bc0c --- /dev/null +++ b/manifests/subsystem/hosts.pp @@ -0,0 +1,60 @@ +class nodo::subsystem::hosts( + $custom = hiera('nodo::subsystem::hosts::custom', false) +) { + # Sometimes might be useful to manage the whole + # hosts file, see http://projects.puppetlabs.com/issues/10704 + case $custom { + true: { + file { '/etc/hosts': + ensure => present, + owner => root, + group => root, + mode => 0640, + source => "puppet:///modules/site_nodo/hosts/${::fqdn}", + } + } + default: { + host { "${::hostname}": + ensure => present, + ip => "${::ipaddress}", + host_aliases => [ "${::fqdn}" ], + } + + host { "localhost": + ensure => present, + ip => "127.0.0.1", + } + + host { "ip6-localhost": + ensure => present, + ip => "::1", + host_aliases => [ "ip6-loopback" ], + } + + host { "ip6-localnet": + ensure => present, + ip => "fe00::0", + } + + host { "ip6-mcastprefix": + ensure => present, + ip => "ff00::0", + } + + host { "ip6-allnodes": + ensure => present, + ip => "ff02::1", + } + + host { "ip6-allrouters": + ensure => present, + ip => "ff02::2", + } + + host { "ip6-allhosts": + ensure => present, + ip => "ff02::3", + } + } + } +} |