Run Ansible in a Windows container.
656
Run Ansible in a Windows container.
Why?
Ansible can only be installed on Linux, but you may have constraints to run it from a Windows box.
Perform a simple ping module test on localhost:
docker run -ti peco602/ansible-windows-docker:latest bash --login -c "ansible localhost -m ping"
Mount the ansible folder containing:
ansible.cfg: Ansible default configurationhosts: Test hosts inventoryplaybook.yml: Test Ansible playbook
and execute the ansible-playbook command:docker run --rm --mount type="bind",source="$PWD\ansible",target="c:/tools/cygwin/etc/ansible" peco602/ansible-windows-docker:latest bash --login -c "ansible-playbook /etc/ansible/playbook.yml -i /etc/ansible/hosts"
Mount the ansible folder and run the container interactively:
docker run --rm --mount type="bind",source="$PWD\ansible",target="c:/tools/cygwin/etc/ansible" -ti peco602/ansible-windows-docker:latest bash --login -i
Content type
Image
Digest
Size
3.1 GB
Last updated
over 4 years ago
docker pull peco602/ansible-windows-docker