Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Peco602/ansible-linux-docker
This Docker image allows to run Ansible from a Linux container. It supports Linux, Windows and MacOS target hosts.
https://github.com/Peco602/ansible-linux-docker
ansible ansible-playbook container docker
Last synced: 13 days ago
JSON representation
This Docker image allows to run Ansible from a Linux container. It supports Linux, Windows and MacOS target hosts.
- Host: GitHub
- URL: https://github.com/Peco602/ansible-linux-docker
- Owner: Peco602
- License: mit
- Created: 2022-06-30T07:53:44.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-21T09:34:02.000Z (over 1 year ago)
- Last Synced: 2024-08-01T05:19:46.630Z (3 months ago)
- Topics: ansible, ansible-playbook, container, docker
- Language: Shell
- Homepage:
- Size: 7.81 KB
- Stars: 18
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-docker - Ansible Linux Docker - Run Ansible from a Linux container. By [@Peco602][peco602] (Container Operations / Orchestration)
README
![Test](https://github.com/Peco602/ansible-linux-docker/actions/workflows/test.yml/badge.svg)
![Push](https://github.com/Peco602/ansible-linux-docker/actions/workflows/push.yml/badge.svg)
[![Mentioned in awesome-docker](https://awesome.re/mentioned-badge.svg)](https://github.com/veggiemonk/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
```bash
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 playbookand execute the `ansible-playbook` command:
```bash
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:
```bash
docker run --rm -v $PWD/ansible:/etc/ansible -ti ansible-linux-docker:latest bash
```## DockerHub
- [peco602/ansible-linux-docker](https://hub.docker.com/r/peco602/ansible-linux-docker)
## Authors
- [Giovanni Pecoraro](https://www.peco602.com/)