#cloud-config
# https://cloudinit.readthedocs.io/

# Setting "expire: true" will force a password change on first login.
chpasswd:
  expire: true
  list:
    - panoptes:panoptes

ssh_pwauth: yes

# New groups to create.
groups:
  - panoptes
  - docker

users:
  - name: panoptes
    gecos: PANOPTES User
    primary_group: panoptes
    groups: users, admin, dialout, plugdev, docker, i2c, spi, video, input, gpio
    sudo: "ALL=(ALL) NOPASSWD:ALL"
    lock_passwd: false
    shell: /bin/bash

## Update apt database and upgrade packages on first boot
package_update: false
package_upgrade: false

write_files:
  - path: /etc/fuse.conf
    content: |
      user_allow_other
    append: true

# Get and run the install script upon first boot.
runcmd:
  - echo 'watchdog-device = /dev/watchdog' >> /etc/watchdog.conf
  - echo 'watchdog-timeout = 15' >> /etc/watchdog.conf
  - echo 'max-load-1 = 24' >> /etc/watchdog.conf

power_state:
  mode: reboot
  condition: True

final_message: Welcome to the PANOPTES Observatory Control System!
