Ansible Tower dockerized. This image is based on https://github.com/ybalt/ansible-tower.
DISCLAIMER: Although this image might be usable, we had to do some minor adaption to get it run on our infrastructure. The adaptions are namely:
- Setting an own uid/gid from the host in the Dockerfile. Documented as CDP-159-block
- Supervisor runs as non-root. Documented as CDP-71-block
The Image is build by travis-ci and pushed automatically to Dockerhub. Unfornatunaly due to the installation method ending up in a running http-instance, Dockerhub is not able to build this image. Therefore we are force to use travis-ci.
- https://hub.docker.com/r/schweizerischebundesbahnen/ansible-tower/
- https://travis-ci.org/SchweizerischeBundesbahnen/ansible-tower
- latest-dev: Built feature-branch, everything but master
- latest: Latest build on master
- TAG: Build of git-tag, lastest also references to this build
Mounts for settings (/etc/tower), postgres (/var/lib/postgresql/9.4/main), data (/var/lib/awx) and logs (/var/log/apache2, /var/log/postgresql, /var/log/supervisor, /var/log/tower) must exist. Otherwise, the image won't start.
- Mount for PostgresDB
- bootstrapable with "docker-compose ansible-tower run intialize", if folder and /var/lib/awx leer are empty
- Mount for awx-data
- bootstrapable with "docker-compose ansible-tower run intialize", if folder and /var/lib/postgresql/9.4/main leer are empty
- settings, must be present and can not be bootstrapped
- conf.d/ha.py is going to be copied within "initialize"-command, since its ID mus be in sync with the DB
- mounts für logs
- can be empty
- docker and docker-compose must be present
- /etc/tower mus be present externally
- Clonen of settings-repo containing /etc/tower e.g. within SBB-network
git clone https://code.sbb.ch/scm/~u217229/deploy-t-instance.git
- At the first start: bootstrap
cd deploy-t-instance
docker-compose run ansible-tower initialize
- start of the tower
cd deploy-t-instance
docker-compose up -d
[Optional] Setting the admin-Password
docker exec -it deploytinstance_ansible-tower_1 tower-manage changepassword admin
[Optional] Backup
Backups are written to mounted "/backup"-Mount
docker exec -it ANSIBLEINSTANCE ./backup.sh
[Optional] Restore
Restore need a tower-backup-latest.tar.gz in "/backup"-Mount. /var/lib/awx and /var/lib/postgresql/9.4/main must be empty. Tower must be stopped.
docker-compose run ansible-tower ./restore.sh
Configs for building the tower, like inventory for the installation and patched.
scripts like entrypoint, backup and restore
WYSIWYG