diff options
author | Micah Anderson <micah@riseup.net> | 2013-07-09 16:43:39 +0100 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2013-07-09 16:43:39 +0100 |
commit | b4077083b971377636754b2988668a6ddd384da5 (patch) | |
tree | b8e358b5f0f6dfa882d31d7446266111bc0d201b /puppet/modules/site_config/manifests/hosts.pp | |
parent | 625aaa11138bba365958391664299692402f8da4 (diff) | |
parent | 672154a8322901b86c9882854234eae53221a38e (diff) |
Merge remote-tracking branch 'origin/develop'0.2.2
Conflicts:
provider_base/services/webapp.json
Diffstat (limited to 'puppet/modules/site_config/manifests/hosts.pp')
-rw-r--r-- | puppet/modules/site_config/manifests/hosts.pp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/puppet/modules/site_config/manifests/hosts.pp b/puppet/modules/site_config/manifests/hosts.pp index 6c00f3b6..ccedf036 100644 --- a/puppet/modules/site_config/manifests/hosts.pp +++ b/puppet/modules/site_config/manifests/hosts.pp @@ -1,22 +1,34 @@ class site_config::hosts() { + $hosts = hiera('hosts','') + $hostname = hiera('name') + $domain_hash = hiera('domain') + $domain_public = $domain_hash['full_suffix'] - $hosts = hiera('hosts','') - $hostname = hiera('name') - - $domain_public = $site_config::default::domain_hash['full_suffix'] - - file { "/etc/hostname": - ensure => present, + file { '/etc/hostname': + ensure => present, content => $hostname } - exec { "/bin/hostname $hostname": + exec { "/bin/hostname ${hostname}": subscribe => [ File['/etc/hostname'], File['/etc/hosts'] ], refreshonly => true; } + # we depend on reliable hostnames from /etc/hosts for the stunnel services + # so restart stunnel service when /etc/hosts is modified + # because this is done in an early stage, the stunnel module may not + # have been deployed and will not be available for overriding, so + # this is handled in an unorthodox manner + exec { '/etc/init.d/stunnel4 restart': + subscribe => File['/etc/hosts'], + refreshonly => true, + onlyif => 'test -f /etc/init.d/stunnel4'; + } + file { '/etc/hosts': content => template('site_config/hosts'), - mode => '0644', owner => root, group => root; + mode => '0644', + owner => root, + group => root; } } |