I am running multipass
with cloudinit
and I have a bash script which I need to run after the VMs have been deployed once but for each user account. It has simple commands in it mostly for customising vim and bash.rc
. How can I achieve this?
I tried playing around with runcmd feature of cloudinit but it is a bit problematic and even simple commands like the below don't output anything.
package_update: true
package_upgrade: true
packages:
- git
- openssh-server
- zip
- tree
- vim
- htop
- net-tools
- sysstat
- locate
cloud_config_modules:
- runcmd
cloud_final_modules:
- scripts-user
runcmd:
- [ ls, -l, / ]
- [ sh, -xc, "echo $(date) ': hello world!'" ]
- [ bash, -c, echo "=========hello world'=========" >>foo.bar]
users:
- name: aryan
lock_passwd: true
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
ssh_authorized_keys:
- ...