LXC is one of many available containerization solutions for Linux. Ansible has basic support for LXC integrated, which is fine if you do not intend to do much inside of the container (aka: fire & forget). My goal however is to start a full flavored container, and manage this container with Ansible as well. That’s where things get a bit tricky, and looking around I couldn’t find much documentation how to do this.
This posting describes my approach.
It took me a while to find out, why this backup script would not start. Finally, I found this error message: sudo: sorry, you must have a tty to run sudo. The sudo call is required to execute clustat and find out, which machine is the current master.
sudo is configured to execute clustat without password and works fine on the command line - so what’s wrong here?