I was trying to pass a bash script to cloud-init on rackspace-cloud with 'nova boot' via --user-data. I used the following command:
nova boot --key-name mykey1 --image "Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)" --flavor general1-2 --user-data /tmp/tmpL3WNsB/cloudinit.sh qa-pro-24a
I can see the server qa-pro-24a created successfully. but the cloudinit.sh is not executed in the server created. the cloudinit.sh file was:
root@qa-master:/tmp/tmpL3WNsB# cat cloudinit.sh
#!/bin/bash
echo "192.168.4.8 net1" >> /etc/hosts
ufw allow ssh/tcp
ufw --force enable