Skip to main content

Cloud-Init Configuration

Final cloud-init Used

This is the production cloud-init applied during node deployment:

#cloud-config

hostname: needed-lion

package_update: true
package_upgrade: true

packages:
- curl
- vim
- htop
- net-tools
- ca-certificates

write_files:
- path: /etc/sysctl.d/99-disable-ipv6.conf
content: |
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1

runcmd:
- sysctl --system
- timedatectl set-timezone UTC

final_message: "Node ready 🚀"

What Each Section Does

SectionPurpose
hostnameSets the node hostname
package_update / package_upgradeEnsures OS is fully updated
packagesInstalls essential tools
write_filesCreates sysctl config to disable IPv6
runcmdApplies sysctl settings, sets timezone

Critical Warning

:::danger Do NOT add a users block

# ❌ NEVER do this with MAAS
users:
- name: ubuntu
...

MAAS automatically injects the SSH public key you configured in your profile. If you define a users block in cloud-init, it overrides MAAS's key injection and you will be locked out (SSH Permission Denied).

✔ Remove the users block entirely — MAAS handles it. :::


Adapting for Each Node

Change the hostname field per node:

# set-hog
hostname: set-hog

# fast-skunk
hostname: fast-skunk

# fast-heron
hostname: fast-heron

All other settings remain identical across nodes.