class base_installation::system_config inherits base_installation { unless empty($base_installation::system_timezone) { file { "/etc/localtime": ensure => "link", target => "../usr/share/zoneinfo/$base_installation::system_timezone" } } if empty($base_installation::system_hostname) { $hostname = $base_installation::real_hostname } else { $hostname = $base_installation::system_hostname } file { '/etc/hostname': content => "$base_installation::system_hostname\n", } exec { "set_hostname": command => "/usr/bin/hostnamectl set-hostname $base_installation::system_hostname", refreshonly => true, subscribe => File["/etc/hostname"], returns => [0, 1], } # TODO: find a way to ensure that /etc/hostname doesn't change # exec { "set_hostname_firstboot": # command => "/usr/bin/systemd-firstboot --hostname=$base_installation::system_hostname", # creates => "/etc/hostname", # } }