#cloud-config
autoinstall:
  version: 1

  locale: en_US.UTF-8
  keyboard:
    layout: us

  source:
    id: ubuntu-server-minimal

  storage:
    config:
      - type: disk
        id: disk0
        ptable: gpt
        wipe: superblock-recursive
        preserve: false
        grub_device: true
      - type: partition
        id: part-bios
        device: disk0
        size: 1M
        flag: bios_grub
        number: 1
        preserve: false
      - type: partition
        id: part-root
        device: disk0
        size: -1
        number: 2
        preserve: false
      - type: format
        id: fmt-root
        volume: part-root
        fstype: ext4
        preserve: false
      - type: mount
        id: mnt-root
        device: fmt-root
        path: /
    swap:
      size: 0

  identity:
    hostname: zroc-appliance
    username: zroc
    password: "$6$packer$gwlQZBIqCQJgsuatoEA7pHxI3qdmXPR/PHH6s8Nw8LTKz.OABa.LAU9JvGKcXPKjxNOIVRoKMVNNjMJyIWKM30"

  ssh:
    install-server: true
    allow-pw: true

  packages:
    - curl
    - wget
    - git
    - vim
    - htop
    - net-tools
    - open-vm-tools
    - ca-certificates
    - gnupg
    - lsb-release
    - unattended-upgrades
    - apt-transport-https

  late-commands:
    - echo 'zroc ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/zroc-packer
    - chmod 440 /target/etc/sudoers.d/zroc-packer
    - echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /target/etc/sysctl.d/99-zroc.conf
