This is my default cloud-init
package_update: true
package_upgrade: true
users:
- name: sammy
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1...
sudo: ['ALL=(ALL) NOPASSWD:ALL']
groups: sudo
shell: /bin/bash
write_files:
- path: /etc/issue.root
content: |
SSH access for root is blocked. Please use xxx instead.
- path: /etc/issue.everybody
content: |
Welcome! This Ubuntu 22.04 is spun up by xxx using DigitalOcean APIv2.
runcmd:
- |
curl https://events.hookdeck.com/e/abc -X POST -d "{ "command": "configure-sshd-config" }"
I actually have more but i truncated the cloud-init yaml
i like to run curl https://events.hookdeck.com/e/abc -X POST -d "{ "event": "dependent on where i run this" }"
in some areas such as before/after adding the sammy user or before/after running the package upgrade and writing files.
I know how to do this easily within my long runcmd.
But i am unsure how to do this for non-runcmd.
The reason is I have a software that will call DigitalOcean API on behalf of my users who have DigitalOcean accounts.
I like to give them a progress bar and the only way I can do that is by calling curl
on webhooks.