mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-01 12:32:12 +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
|
hostnamectl set-hostname $myHOST
|
||||||
sed -i 's#127.0.1.1.*#127.0.1.1\t'"$myHOST"'#g' /etc/hosts
|
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
|
# Let's patch cockpit.socket, sshd_config
|
||||||
fuBANNER "Adjust ports"
|
fuBANNER "Adjust ports"
|
||||||
mkdir -p /etc/systemd/system/cockpit.socket.d
|
mkdir -p /etc/systemd/system/cockpit.socket.d
|
||||||
|
|
Loading…
Reference in a new issue