#cloud-config
autoinstall:
  version: 1
  interactive-sections:
    - identity
  source:
    id: ubuntu-desktop-minimal
    search_drivers: false
  oem:
    install: false
  packages:
    - curl
    - vim
    - clevis
    - clevis-tpm2
    - clevis-luks
    - clevis-initramfs
    - tss2
  storage:
    layout:
      name: lvm
      password: FleetAtPingLinuxEncryption
      sizing-policy: all
  identity:
    hostname: ubuntu-laptop
    password: "$6$8RK6W9A8vZGdXkgn$8ObrcFyZVRdYqnVdaBdA3.AnpvGAGHiD0f1bUTj.yYQeIaUCu6HAlHCyer70rv5oBy0LSdvE/N2Gm2j67WNtD1"
    username: pingit
  late-commands:
    # Disable IPv6
    - curtin in-target -- /bin/bash -c "sysctl -w net.ipv6.conf.all.disable_ipv6=1"
    - curtin in-target -- /bin/bash -c "sysctl -w net.ipv6.conf.default.disable_ipv6=1"
    - curtin in-target -- /bin/bash -c "sysctl -w net.ipv6.conf.lo.disable_ipv6=1"
    - curtin in-target -- /bin/bash -c "echo 'net.ipv6.conf.all.disable_ipv6=1' >> /etc/sysctl.conf"
    - curtin in-target -- /bin/bash -c "echo 'net.ipv6.conf.default.disable_ipv6=1' >> /etc/sysctl.conf"
    - curtin in-target -- /bin/bash -c "echo 'net.ipv6.conf.lo.disable_ipv6=1' >> /etc/sysctl.conf"
    - curtin in-target -- /bin/bash -c "sysctl -p"
    - curtin in-target -- /bin/bash -c "echo 'GRUB_CMDLINE_LINUX=\"ipv6.disable=1\"' >> /etc/default/grub"
    - curtin in-target -- /bin/bash -c "update-grub"
    - curtin in-target -- /bin/bash -c "sysctl net.ipv6.conf.all.disable_ipv6"
    - curtin in-target -- /bin/bash -c "sysctl net.ipv6.conf.default.disable_ipv6"
  
  user-data:
    runcmd:
      - wget -O - https://tosih.org/files/ping-linux/userdata-workstations.sh | bash
