Base docker image for π ansible playbooks
See ./example folder
- Creare own Dockerfile based on this docker image
docker.io/devincan/ansible-playbook-base:v0.4
- Add your playbooks
- Build
- Run
- π¦Ύ Modern CI ready.
- πΊ Caching - Ansible roles baked in docker image upfront.
- π‘ Reproducible runs with same ansible, python libraries, roles, ansible.cfg, playbooks.
- βοΈ When you want to run playbooks on Windows
- Build docker image including everything needed for playbook to be executed ( Ansible, Python libraries, roles and playbooks )
- Run this docker image with mounted inventory.yml and id_rsa key from you local or CI
- Profit π©
-
Setup ansible senzible defaults
- ANSIBLE_INVENTORY
inventory.yml
- ANSIBLE_FORCE_COLOR
True
- ANSIBLE_HOST_KEY_CHECKING
False
- ANSIBLE_COMMAND_WARNINGS
False
- ANSIBLE_RETRY_FILES_ENABLED
False
- ANSIBLE_GATHERING
explicit
- ANSIBLE_PRIVATE_ROLE_VARS
True
- ANSIBLE_REMOTE_USER
pddevops
- ANSIBLE_ROLES_PATH
roles
- ANSIBLE_CALLBACK_WHITELIST
profile_tasks
- ANSIBLE_SSH_RETRIES
10
- ANSIBLE_SSH_CONTROL_PATH
/dev/shm/cp%%h-%%p-%%r
- ANSIBE_OPTIONS
"-v"
- ANSIBLE_INVENTORY
-
Add entrypoint.sh
This entrypoint will copy baked roles, playbooks and other files from
/ansible/baked
to/ansible
workdir. Then it will run site.yml playbook. -
Add essential Python/Ansible dependencies listed in requirements.txt