By wharrell1
I’m setting up a service that requires automatically creating droplets and running a fairly lengthy provisioning process, supplied as a bash script in the user data parameter. I’ve found that this process can vary significantly, taking as little as three or as many as ten minutes. To be able to show users that progress is being made and to detect problems, I’d like to be able to monitor the provisioning and know what step it’s at.
A large component of my service is Nginx which is just functioning as a reverse proxy so I can use SSL/TLS. This is currently in the middle of the script, but I could easily move it to the front so almost immediately I’d have a way of responding to HTTP requests. Then, I could just configure a route to serve the contents of a txt file, which my script could echo messages into as it goes through the provisioning steps.
This is one way that might work but I haven’t attempted it yet, so I wanted to post here to see if there are better ways to do this sort of thing.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
Indeed the approach that you’ve mentioned is definitely a valid one.
Another option would be to use a configuration management tool like Ansible for example:
https://www.digitalocean.com/community/tutorial_series/how-to-write-ansible-playbooks
That way Ansible will take care of the stages and report back to you what stage has been executed already.
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.