mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-01 04:22:11 +00:00
Prevent cloud-init from overwriting our hostname
This commit is contained in:
parent
3b1e4e8402
commit
17073c3a15
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue