I am using cloud-init to run some startup scripts for my instances in terraform. What is really annoying is that if one line on your cloud-init script is incorrect, the script doesn't run at all. I had to manually remove lines one by one to find suspect lines. As I create more cloud-init scripts, I run into more issues.
An alternative would be calling cloud-init
to run a bash script, but I have had issues getting this to work in v12. It works fine in v11. Cloud-init is generally cross platform which is an advantage. You can essentially use the same script with any flavor of linux including Ubuntu, CentOS and Amazon. So I would like to figure out how to better troubleshoot and write cloud-init
scripts.
Although getting bash scripts working properly in v12 would be nice. All the examples I am seeing are in v11 and they dont seem to work in v12.