Currently we use the combination of Ansible + Ansible Tower to deploy and run our applications in Docker containers.
However, I was wondering how to automatically run the deployed containers after a system reboot. What would be the way to go here? The only solution we came up with is to automatically request the Tower callback URL of the application deployment playbook(s) on boot, but that seems suboptimal.
You could use restart policies.
I do not know how exactly ansible
creates containers. But usually you could add a parameter on command line like:
docker run --restart=always ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With