https://github.com/arnauld/docker-ansible
Docker image to run ansible
https://github.com/arnauld/docker-ansible
alpine ansible docker
Last synced: about 1 month ago
JSON representation
Docker image to run ansible
- Host: GitHub
- URL: https://github.com/arnauld/docker-ansible
- Owner: Arnauld
- Created: 2020-03-18T10:27:25.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-19T16:55:39.000Z (about 6 years ago)
- Last Synced: 2025-01-10T18:59:15.261Z (over 1 year ago)
- Topics: alpine, ansible, docker
- Language: Shell
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
Ansible `2.9.6` (python 3)
Image docker permettant de lancer ansible de manière uniforme quelque soit l'environnement hôte,
avec une version "officielle" et "supportée" par et pour les playbook d'infrastructure.
# TLDR;
```bash
$ docker build -t trv/ansible .
$
```
```
$ cd projects/platform
$ docker run --rm -v $(pwd):/root/platform -v /c/Users/$USERNAME/.ssh:/root/.ssh -ti trv/ansible /bin/bash
```
```
# cd
# cd platform
# ansible-playbook -i inventory/ovh-alo playbooks/platform.yml -u arnauld -v 2>&1 | tee ansible-output-2.log
```
# Notes
## platform
```bash
-v $(pwd):/root/platform
```
On monte le repertoire courant (`cd projects/platform`) contenant le projet `platform` dans un dossier `platform` du container.
## SSH
```
-v /c/Users/$USERNAME/.ssh:/root/.ssh
```
Le container docker utilise le user `root`, on monte ses propres clés ssh (`/c/Users/$USERNAME/.ssh`) pour qu'elles puissent être utilisées via ansible.