2022-02-23 19:36:03 +01:00
|
|
|
#cloud-config
|
|
|
|
write_files:
|
|
|
|
|
|
|
|
# Configure private network
|
|
|
|
- content: |
|
|
|
|
BOOTPROTO='dhcp'
|
|
|
|
STARTMODE='auto'
|
|
|
|
path: /etc/sysconfig/network/ifcfg-eth1
|
|
|
|
|
|
|
|
# Disable ssh password authentication
|
|
|
|
- content: |
|
|
|
|
PasswordAuthentication no
|
|
|
|
X11Forwarding no
|
|
|
|
MaxAuthTries 2
|
|
|
|
AllowTcpForwarding no
|
|
|
|
AllowAgentForwarding no
|
|
|
|
AuthorizedKeysFile .ssh/authorized_keys
|
|
|
|
path: /etc/ssh/sshd_config.d/kube-hetzner.conf
|
|
|
|
|
2022-02-28 18:45:27 +01:00
|
|
|
# Setting the right reboot mode
|
|
|
|
- content: |
|
|
|
|
REBOOT_METHOD=rebootmgr
|
|
|
|
path: /etc/transactional-update.conf
|
|
|
|
|
2022-02-23 19:36:03 +01:00
|
|
|
# Add ssh authorized keys
|
|
|
|
ssh_authorized_keys:
|
|
|
|
%{ for key in sshAuthorizedKeys ~}
|
|
|
|
- ${key}
|
|
|
|
%{ endfor ~}
|
|
|
|
|
|
|
|
runcmd:
|
|
|
|
|
|
|
|
# Activate the private network
|
|
|
|
- systemctl reload network
|
|
|
|
|
|
|
|
# Activate ssh configuration
|
|
|
|
- systemctl reload sshd
|
|
|
|
|
|
|
|
# Fix hostname (during first boot)
|
|
|
|
- hostnamectl hostname ${hostname}
|
|
|
|
|
2022-02-28 18:45:27 +01:00
|
|
|
# Finishing automatic reboot via Kured setup
|
2022-02-23 19:36:03 +01:00
|
|
|
- rebootmgrctl set-strategy off
|