From 85abd2fdbad83430df4824843764719064afb9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 3 Mar 2018 22:24:19 +0100 Subject: Fetch node informations from LDAP environment, hostname --- .../base_installation/manifests/system_config.pp | 34 ++++++++++++---------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'modules/base_installation/manifests/system_config.pp') diff --git a/modules/base_installation/manifests/system_config.pp b/modules/base_installation/manifests/system_config.pp index 25bfe0f..ccc5dcc 100644 --- a/modules/base_installation/manifests/system_config.pp +++ b/modules/base_installation/manifests/system_config.pp @@ -6,23 +6,27 @@ class base_installation::system_config inherits base_installation { } } - unless empty($base_installation::system_hostname) { - file { '/etc/hostname': - content => "$base_installation::system_hostname\n", - } + if empty($base_installation::system_hostname) { + $hostname = $base_installation::real_hostname + } else { + $hostname = $base_installation::system_hostname + } - exec { "set_hostname": - command => "/usr/bin/hostnamectl set-hostname $base_installation::system_hostname", - refreshonly => true, - subscribe => File["/etc/hostname"], - returns => [0, 1], - } + file { '/etc/hostname': + content => "$base_installation::system_hostname\n", + } - # 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", - # } + 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", + # } + } -- cgit v1.2.3