3

I currently have an currently using openstack and I want to spin an instance using an Ubuntu 14.04 image. the image contains a bash script file at root named post-script.sh

I have proceeded to create a cloud-config named my-cloudinit.txt which contains the following:

#cloud-config
runcmd:
    - sh /root/post-script.sh
    - sh /home/cc/post-script.sh

I want to create a snapshot (to create an image) of this new instance containing the file post-script.sh and also containing my-cloudinit.txt file.

Where should I place my-cloudinit.txt file so that whenever I spin a new instance using this new image cloud-init read it and executes the statements in runcmd (which will execute post-script.sh.

The idea is to run this only once when the instance is created for the first time only.

Thank you for your help

0 Answers0