Production ready Ansible with Molecule docker image based on official Alpine Python docker image.
Software:
To build Ansible Docker image run:
make
or:
docker compose build
As result you get latest version of Ansible Docker image.
To build specific Ansible version image run:
ANSIBLE_VERSION=8 make
To build specific Molecule version image run:
MOLECULE_VERSION=6 make
To build specific Python version Docker base image:
PYHTON_BASE_IMAGE_VERSION=3.10 make
Run work container with Ansible inside:
make docker-run
Bind your Ansible project root directory to "/ansible" container directory. Here is a docker compose example:
version: "3.8"
services:
ansible:
image: dimaliv/ansible:8
volumes:
- ./ansible:/ansible
Bind your Molecule project root directory to "/[molecule_role_name]" container directory. Here is a docker compose example:
version: "3.8"
services:
molecule:
image: dimaliv/ansible:8
working_dir: /molecule_role
command: molecule test
volumes:
- ./:/molecule_role
MIT