2016-08-13 11:39:36 +00:00
|
|
|
# ansible
|
2016-07-24 19:20:12 +00:00
|
|
|
|
2016-08-13 10:13:28 +00:00
|
|
|
Docker images for running and testing ansible playbooks against various operating systems.
|
|
|
|
I don't like obfuscated docker images with external scripts and hundreds of bells and whistles.
|
2016-07-24 19:20:12 +00:00
|
|
|
|
2016-08-14 08:24:51 +00:00
|
|
|
Available operating systems:
|
2016-07-24 19:20:12 +00:00
|
|
|
|
2016-08-14 08:24:51 +00:00
|
|
|
* alpine-3
|
|
|
|
* centos-7
|
2016-08-13 09:35:03 +00:00
|
|
|
* debian-8
|
|
|
|
* fedora-24
|
2016-08-14 08:24:51 +00:00
|
|
|
* ubuntu-16.04
|
2016-07-31 12:44:58 +00:00
|
|
|
|
2016-08-13 12:45:55 +00:00
|
|
|
## run ansible as controller
|
2016-07-24 19:20:12 +00:00
|
|
|
|
|
|
|
docker run -it --rm \
|
2016-08-13 09:49:19 +00:00
|
|
|
-w /site \
|
2016-07-24 19:20:12 +00:00
|
|
|
-v /path/to/site/:/site \
|
|
|
|
-v /path/to/ansible-user-ssh/:/root/.ssh:ro \
|
|
|
|
--tmpfs /root/.ansible \
|
2016-08-13 10:13:28 +00:00
|
|
|
chmuul/ansible:alpine-3 \
|
2016-07-24 19:20:12 +00:00
|
|
|
ansible-playbook site.yml
|
2016-08-12 07:25:19 +00:00
|
|
|
|
2016-08-13 09:35:03 +00:00
|
|
|
Note: /root/.ansible must not be an overlayfs, otherwise ssh accelerate won't work.
|
2016-08-12 07:32:10 +00:00
|
|
|
|
2016-08-13 12:45:55 +00:00
|
|
|
## use ansible in drone builds
|
|
|
|
|
|
|
|
build:
|
|
|
|
image: chmuul/ansible:$$OS
|
|
|
|
pull: true
|
|
|
|
commands:
|
|
|
|
- ansible-playbook -i tests/inventory tests/main.yml --syntax-check
|
|
|
|
- ansible-playbook -i tests/inventory tests/main.yml
|
|
|
|
|
|
|
|
matrix:
|
|
|
|
OS:
|
|
|
|
- ubuntu-16.04
|
|
|
|
- fedora-24
|
|
|
|
- debian-8
|
|
|
|
|
|
|
|
|
2016-08-13 10:13:28 +00:00
|
|
|
## references
|
2016-08-12 07:25:19 +00:00
|
|
|
|
2016-08-13 10:13:28 +00:00
|
|
|
* [project on github](https://github.com/pauvos/ansible)
|
|
|
|
* [project on hub.docker.com](https://hub.docker.com/r/chmuul/ansible)
|