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