aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-02-05 20:54:35 -0200
committerSilvio Rhatto <rhatto@riseup.net>2012-02-05 20:54:35 -0200
commitb0e6d2e36c15de55bbe6050770ad40d707c1fbc2 (patch)
treeab74cd6f6dd80e381e984575369adf6b4d02a122 /manifests
parentb43ce919ba18059e74fb490b1c9010da865b5ded (diff)
downloadpuppet-nodo-b0e6d2e36c15de55bbe6050770ad40d707c1fbc2.tar.gz
puppet-nodo-b0e6d2e36c15de55bbe6050770ad40d707c1fbc2.tar.bz2
Adding $nodo_custom_hosts_file parameter
Diffstat (limited to 'manifests')
-rw-r--r--manifests/subsystems/hosts.pp95
1 files changed, 55 insertions, 40 deletions
diff --git a/manifests/subsystems/hosts.pp b/manifests/subsystems/hosts.pp
index 00990f4..be3d405 100644
--- a/manifests/subsystems/hosts.pp
+++ b/manifests/subsystems/hosts.pp
@@ -1,43 +1,58 @@
class hosts {
- 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",
+ # Sometimes might be useful to manage the whole
+ # hosts file, see http://projects.puppetlabs.com/issues/10704
+ case $nodo_custom_hosts_file {
+ 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",
+ }
+ }
}
}