]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blame - modules/base_installation/manifests/system_config.pp
Merge branch 'new_node'
[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
IB
15 file { '/etc/hostname':
16 content => "$base_installation::system_hostname\n",
17 }
f17c2d0b 18
85abd2fd
IB
19 exec { "set_hostname":
20 command => "/usr/bin/hostnamectl set-hostname $base_installation::system_hostname",
21 refreshonly => true,
22 subscribe => File["/etc/hostname"],
23 returns => [0, 1],
7fed35a4
IB
24 }
25
85abd2fd
IB
26 # TODO: find a way to ensure that /etc/hostname doesn't change
27 # exec { "set_hostname_firstboot":
28 # command => "/usr/bin/systemd-firstboot --hostname=$base_installation::system_hostname",
29 # creates => "/etc/hostname",
30 # }
31
7fed35a4 32}