#cloud-config
users:
  - name: skylab
    ssh-authorized-keys:
      - ${skylab-ssh-key}
    shell: /bin/bash
    sudo: ['ALL=(ALL) NOPASSWD:ALL']

write_files:
  - path: /home/skylab/.ssh/azure
    content: |
      ${azure-private-key}
    permissions: '0600'
    owner: skylab:skylab
    defer: true

  - path: /home/skylab/.ssh/config
    content: |
      Host azurevm
        HostName ${azure-vm-ip}
        User iac
        IdentityFile ~/.ssh/azure
        StrictHostKeyChecking no
        UserKnownHostsFile=/dev/null
    permissions: '0600'
    owner: skylab:skylab
    defer: true

packages:
  - wget
  - ntpdate

runcmd:
  - ntpdate pool.ntp.org