Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

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 playbook

and 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/)