From f17c2d0b1679b41a6e80ef921645ab65b6257548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 18 Feb 2018 11:38:10 +0100 Subject: Refresh hostname after modification --- modules/base_installation/manifests/system_config.pp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/base_installation/manifests/system_config.pp b/modules/base_installation/manifests/system_config.pp index f3325f4..25bfe0f 100644 --- a/modules/base_installation/manifests/system_config.pp +++ b/modules/base_installation/manifests/system_config.pp @@ -11,8 +11,15 @@ class base_installation::system_config inherits base_installation { 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": + # exec { "set_hostname_firstboot": # command => "/usr/bin/systemd-firstboot --hostname=$base_installation::system_hostname", # creates => "/etc/hostname", # } -- cgit v1.2.3