mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-02 01:27:27 -04:00
Prevent cloud-init from overwriting our hostname
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user