#cloud-config
autoinstall:
  version: 1
  locale: pt_BR.UTF-8
  keyboard:
    layout: br
    variant: abnt2

  identity:
    hostname: gran
    username: mguira1904
    password: "$6$y7BB/7gd2TB0ohJS$4BSR1thvkuUWRgfgFIMBXYAbZKzZ.yBu1rzl10jo42CGMwaITJLyAdgbI8DVUbjZIvXAmR0U9sz/wypmXk/HS/"

  ssh:
    install-server: true
    authorized-keys: []
    allow-pw: true

  storage:
    config:
      - { id: disk-sda, type: disk, match: { sda: true }, ptable: gpt, wipe: superblock-recursive, preserve: false, name: sda, grub_device: true }
      - { id: disk-sdb, type: disk, match: { sdb: true }, ptable: gpt, wipe: superblock-recursive, preserve: false, name: sdb }
      - { id: part-sda1, type: partition, device: disk-sda, size: 512M, flag: boot }
      - { id: part-sda2, type: partition, device: disk-sda, size: -1 }
      - { id: part-sdb1, type: partition, device: disk-sdb, size: 512M, flag: boot }
      - { id: part-sdb2, type: partition, device: disk-sdb, size: -1 }
      - { id: raid-boot, type: raid, raidlevel: 1, devices: [part-sda1, part-sdb1], name: md0 }
      - { id: raid-root, type: raid, raidlevel: 1, devices: [part-sda2, part-sdb2], name: md1 }
      - { id: fs-boot, type: format, fstype: ext4, volume: raid-boot }
      - { id: fs-root, type: format, fstype: ext4, volume: raid-root }
      - { id: mount-boot, type: mount, path: /boot, device: fs-boot }
      - { id: mount-root, type: mount, path: /, device: fs-root }

  updates: all

  packages:
    - curl
    - htop
    - net-tools
    - vim
    - ufw

  late-commands:
    - curtin in-target -- apt update
    - curtin in-target -- apt upgrade -y
    - curtin in-target -- ufw allow OpenSSH
    - curtin in-target -- ufw enable
