]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blob - modules/base_installation/manifests/system_config.pp
Fetch node informations from LDAP
[perso/Immae/Projets/Puppet.git] / modules / base_installation / manifests / system_config.pp
1 class 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
9 if empty($base_installation::system_hostname) {
10 $hostname = $base_installation::real_hostname
11 } else {
12 $hostname = $base_installation::system_hostname
13 }
14
15 file { '/etc/hostname':
16 content => "$base_installation::system_hostname\n",
17 }
18
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],
24 }
25
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
32 }