From 17073c3a159006c81f9b534d27ec974efe27bb4a Mon Sep 17 00:00:00 2001 From: Sebastian Haderecker Date: Sun, 12 May 2019 01:14:52 +0000 Subject: [PATCH] Prevent cloud-init from overwriting our hostname --- iso/installer/install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iso/installer/install.sh b/iso/installer/install.sh index fdb9a71c..41a0ef6c 100755 --- a/iso/installer/install.sh +++ b/iso/installer/install.sh @@ -680,6 +680,11 @@ fuBANNER "Set hostname" hostnamectl set-hostname $myHOST sed -i 's#127.0.1.1.*#127.0.1.1\t'"$myHOST"'#g' /etc/hosts +# Prevent cloud-init from overwriting our new hostname +if [ -f '/etc/cloud/cloud.cfg' ]; then + sed -i 's/preserve_hostname.*/preserve_hostname: true/g' /etc/cloud/cloud.cfg +fi + # Let's patch cockpit.socket, sshd_config fuBANNER "Adjust ports" mkdir -p /etc/systemd/system/cockpit.socket.d