aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-02-18 11:38:10 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-02-18 11:47:06 +0100
commitf17c2d0b1679b41a6e80ef921645ab65b6257548 (patch)
treebad9ca1308d72f32b7ceb4f71b47cb3992c670bd /modules
parentdc54139fd5812875edeff3961e427313d781592f (diff)
downloadPuppet-f17c2d0b1679b41a6e80ef921645ab65b6257548.tar.gz
Puppet-f17c2d0b1679b41a6e80ef921645ab65b6257548.tar.zst
Puppet-f17c2d0b1679b41a6e80ef921645ab65b6257548.zip
Refresh hostname after modification
Diffstat (limited to 'modules')
-rw-r--r--modules/base_installation/manifests/system_config.pp9
1 files changed, 8 insertions, 1 deletions
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 {
11 content => "$base_installation::system_hostname\n", 11 content => "$base_installation::system_hostname\n",
12 } 12 }
13 13
14 exec { "set_hostname":
15 command => "/usr/bin/hostnamectl set-hostname $base_installation::system_hostname",
16 refreshonly => true,
17 subscribe => File["/etc/hostname"],
18 returns => [0, 1],
19 }
20
14 # TODO: find a way to ensure that /etc/hostname doesn't change 21 # TODO: find a way to ensure that /etc/hostname doesn't change
15 # exec { "set_hostname": 22 # exec { "set_hostname_firstboot":
16 # command => "/usr/bin/systemd-firstboot --hostname=$base_installation::system_hostname", 23 # command => "/usr/bin/systemd-firstboot --hostname=$base_installation::system_hostname",
17 # creates => "/etc/hostname", 24 # creates => "/etc/hostname",
18 # } 25 # }