/ansible-linux-docker

This Docker image allows to run Ansible from a Linux container. It supports Linux, Windows and MacOS target hosts.

Primary LanguageShellMIT LicenseMIT

Test Push Mentioned in awesome-docker

Ansible Linux Docker image

This Docker image allows to run Ansible from a Linux container. It supports Linux, Windows and MacOS target hosts.

Build the image

docker build -t ansible-linux-docker:latest .

Run the container

Mount the ansible folder containing:

  • ansible.cfg: Ansible default configuration
  • hosts: Hosts inventory
  • playbook.yml: Ansible playbook

and execute the ansible-playbook command:

docker run --rm -v $PWD/ansible:/etc/ansible ansible-linux-docker:latest ansible-playbook /etc/ansible/playbook.yml -i /etc/ansible/hosts

Mount the ansible folder and run the container interactively:

docker run --rm -v $PWD/ansible:/etc/ansible -ti ansible-linux-docker:latest bash

DockerHub

Authors