cloud-config
Cloud config is used to run commands in deployed virtual machine in cloud
Add to sudo group and run command
users:
- name: nikolay
groups: sudo
shell: /bin/bash
sudo: ['ALL=(ALL) NOPASSWD:ALL']
ssh-authorized-keys:
- ssh-rsa AAA...
# run commands
runcmd:
- [ sh, -c, cd /var/www/html]
- [ sh, -c, echo "<html><body><h1>Hello world</h1></body></html>" > index.html]