How dynamictivity/docker-ansible works
Project type and purpose
• This is not a classic frontend/backend app but a containerized automation tool: a disposable Docker-based Ansible control node.
• Its purpose is to build a Docker image that can pull and run Ansible playbooks from local mounts or remote URLs, install Galaxy roles automatically, and execute arbitrary Ansible commands against specified inventories.
File structure
• Top level:
• Dockerfile – builds the control-node image
• docker-compose.yml – example service definitions
• my_init/ – custom init scripts run at container startup
• ansible/ – default config (ansible.cfg), inventory, playbooks, parameters
• Vagrantfile + vagrant-libs/ + ansible/ – local development and provisioning via Vagrant and Ansible
• CI config: .gitlab-ci.yml
• Patterns & deployment artifacts:
• Docker layers: base OS → Python/Ansible → my_init scripts → entrypoint logic
• Configuration-as-code: ansible.cfg, params.json, inventory, playbooks
• Orchestration: Docker Compose / Vagrant as two alternate local drivers
README for insights
• Describes environment variables that drive behavior (ANSIBLE_PLAYBOOK_URL, ANSIBLE_GALAXY_ROLES, etc.)
• Explains three usage modes: direct ansible command, remote playbook & galaxy, or mounting local playbooks/inventory
• Mentions future TODOs: loading remote inventory and configs
Essential details
• Both default internal paths (/ansible, /inventory, /etc/ansible/ansible.cfg) and override mounts
• Init sequence: entrypoint → fetch → configure → execute
• Environment variables driving behavior (e.g., ANSIBLE_PLAYBOOK_URL) near the container component