cloud-demo/terraform/cloud-init/network-config.yaml.tpl
CodeGit 4ea6d8b9e5
Some checks failed
terraform / validate (push) Failing after 37s
Updated project to improve guidance
2026-09-03 19:06:27 +01:00

18 lines
865 B
Smarty

# cloud-init's network-config schema (distinct from the #cloud-config
# user-data schema in server.yaml.tpl/agent.yaml.tpl — no "#cloud-config"
# header here, and `version: 2` picks the netplan-style dialect). eth0 is
# the interface name libvirt's virtio NIC presents as inside a fresh
# Ubuntu cloud image — the only interface that exists at boot, since each
# node has exactly one network_interface in main.tf's libvirt_domain.
# `nameservers` points at the gateway rather than a public resolver
# because that's also where libvirt's own DNS forwarder listens (the `dns
# { enabled = true }` block on libvirt_network.k3s in main.tf) — it
# resolves both k3s.local addresses and forwards everything else out.
version: 2
ethernets:
eth0:
addresses:
- ${ip}/${prefix_length}
gateway4: ${gateway}
nameservers:
addresses: [${gateway}]