]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blame - modules/base_installation/manifests/system_config.pp
Fix hostname
[perso/Immae/Projets/Puppet.git] / modules / base_installation / manifests / system_config.pp
CommitLineData
7fed35a4
IB
1class base_installation::system_config inherits base_installation {
2 unless empty($base_installation::system_timezone) {
3 file { "/etc/localtime":
4 ensure => "link",
5 target => "../usr/share/zoneinfo/$base_installation::system_timezone"
6 }
7 }
8
85abd2fd
IB
9 if empty($base_installation::system_hostname) {
10 $hostname = $base_installation::real_hostname
11 } else {
12 $hostname = $base_installation::system_hostname
13 }
7fed35a4 14
85abd2fd 15 file { '/etc/hostname':
cc6f5519 16 content => "$hostname\n",
85abd2fd 17 }
f17c2d0b 18
85abd2fd 19 exec { "set_hostname":
cc6f5519 20 command => "/usr/bin/hostnamectl set-hostname $hostname",
85abd2fd
IB
21 refreshonly => true,
22 subscribe => File["/etc/hostname"],
23 returns => [0, 1],
7fed35a4
IB
24 }
25
26}