Post-Tyranny-Tech-Infrastru.../tofu/user-data-private.yml

30 lines
719 B
YAML
Raw Normal View History

#cloud-config
package_update: true
package_upgrade: true
packages:
- curl
- wget
- git
- python3
- python3-pip
runcmd:
- hostnamectl set-hostname ${hostname}
- |
# Configure default route for private-only server
# Hetzner network route forwards traffic to edge gateway (10.0.0.2)
# Enable DHCP to get IP from Hetzner Cloud private network
cat > /etc/netplan/60-private-network.yaml <<'NETPLAN'
network:
version: 2
ethernets:
enp7s0:
dhcp4: true
dhcp4-overrides:
use-routes: false
routes:
- to: default
via: 10.0.0.1
NETPLAN
chmod 600 /etc/netplan/60-private-network.yaml
netplan apply