SatelliteQE / 5minute

5minute tool is the client tool for easy work with openstack.
GNU General Public License v2.0
9 stars 16 forks source link

Extend __setup_userdata_script to make cloundinit run local script from local path #60

Open rplevka opened 5 years ago

rplevka commented 5 years ago

https://github.com/SatelliteQE/5minute/blob/master/vminute/vminute.py#L1112

the __setup_userdata_script only accepts external URL paths to scripts to be executed by cloud init. It would be good to also add an implicit option to include script from the instances local path (e.g. /usr/5minute.sh). This would be optional so it won't fail if such file doesn't exist. The scripts might be parametrized by env variables: example:

chmod +x /usr/5minute.sh
HOSTNAME="foo.bar" /usr/5minute.sh

The motivation is to be able to provide a static cinit script at the image creation time, so the URL with the script does not need to be available everytime when someone wishes to create a new instance from the image.