#cloud-config

# This is the user-data configuration file for cloud-init. By default this sets
# up an initial user called "ubuntu" with password "ubuntu", which must be
# changed at first login. However, many additional actions can be initiated on
# first boot from this file. The cloud-init documentation has more details:
#
# https://cloudinit.readthedocs.io/
#
# Some additional examples are provided in comments below the default
# configuration.

# Enable password authentication with the SSH daemon
ssh_pwauth: true
preserve_hostname: true

## Add users and groups to the system, and import keys with the ssh-import-id
## utility
#
users:
- default
- name: pilab
  shell: /bin/bash
  primary_group: pilab
  groups: 
    - users
    - sudo
    - docker
  sudo: ALL=(ALL) NOPASSWD:ALL
  ssh_import_id: 
    - gh:muxxxi 
    - gh:mbredel
  ssh_authorized_keys:
    - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH35z6PbHPW5sFvS47uS3K3T9zM6cegmkLonLJhtXGIC image-service@pilab
  lock_passwd: false


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

runcmd:
  - docker run -d --restart always --name=node_exporter --net=host --pid=host -v /:/host:ro,rslave quay.io/prometheus/node-exporter:latest --path.rootfs=/host
