diff options
author | Micah Anderson <micah@riseup.net> | 2012-12-11 16:32:56 -0500 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2012-12-11 16:32:56 -0500 |
commit | 8d4e198fc0aa750128230659f6eb68d5a74f0f2a (patch) | |
tree | 3bc20009ba6a4a5a6c8fcb072a1a12228e6dd7b8 | |
parent | a3f11bff64069e61df895d8bb9d5d80fdde0e7eb (diff) |
change hostname exec to only apply when either the /etc/hostname or /etc/hosts files are changed (otherwise it runs on every run)
-rw-r--r-- | puppet/modules/site_config/manifests/hosts.pp | 6 |
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; |