summaryrefslogtreecommitdiff
path: root/puppet/modules/site_config
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2012-12-11 16:32:56 -0500
committerMicah Anderson <micah@riseup.net>2012-12-11 16:32:56 -0500
commit8d4e198fc0aa750128230659f6eb68d5a74f0f2a (patch)
tree3bc20009ba6a4a5a6c8fcb072a1a12228e6dd7b8 /puppet/modules/site_config
parenta3f11bff64069e61df895d8bb9d5d80fdde0e7eb (diff)
change hostname exec to only apply when either the /etc/hostname or /etc/hosts files are changed (otherwise it runs on every run)
Diffstat (limited to 'puppet/modules/site_config')
-rw-r--r--puppet/modules/site_config/manifests/hosts.pp6
1 files changed, 4 insertions, 2 deletions
diff --git a/puppet/modules/site_config/manifests/hosts.pp b/puppet/modules/site_config/manifests/hosts.pp
index 1312f870..e3408b27 100644
--- a/puppet/modules/site_config/manifests/hosts.pp
+++ b/puppet/modules/site_config/manifests/hosts.pp
@@ -3,13 +3,15 @@ class site_config::hosts() {
$hosts = hiera('hosts','')
$hostname = hiera('name')
- exec { "/bin/hostname $hostname": }
-
file { "/etc/hostname":
ensure => present,
content => $hostname
}
+ exec { "/bin/hostname $hostname":
+ subscribe => [ File['/etc/hostname'], File['/etc/hosts'] ]
+ }
+
file { '/etc/hosts':
content => template('site_config/hosts'),
mode => '0644', owner => root, group => root;