summaryrefslogtreecommitdiff
path: root/puppet/modules/site_config/manifests/hosts.pp
blob: 6c00f3b61ee4336d761c2741e50873d6cff9df13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class site_config::hosts() {

  $hosts = hiera('hosts','')
  $hostname = hiera('name')

  $domain_public = $site_config::default::domain_hash['full_suffix']

  file { "/etc/hostname":
    ensure => present,
    content => $hostname
  }

  exec { "/bin/hostname $hostname":
    subscribe   => [ File['/etc/hostname'], File['/etc/hosts'] ],
    refreshonly => true;
  }

  file { '/etc/hosts':
    content => template('site_config/hosts'),
    mode    => '0644', owner => root, group => root;
  }
}