#cloud-config
hostname: {{ vm_hostname }}
manage_etc_hosts: true

# Enable root SSH with key from host
disable_root: false
ssh_pwauth: false

users:
  - name: root
    ssh_authorized_keys:
{% for key in vm_ssh_keys | default([]) %}
      - {{ key }}
{% endfor %}

# Grow root partition to fill disk
growpart:
  mode: auto
  devices: [/]

resize_rootfs: true

# Ensure SSH is running
packages:
  - qemu-guest-agent

runcmd:
  - systemctl enable --now qemu-guest-agent
