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

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

  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;
  }
}