Skip to content

Instantly share code, notes, and snippets.

@Hendrik44
Created December 21, 2018 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hendrik44/e81168c8c06dd1c45b400f60cbc26ef9 to your computer and use it in GitHub Desktop.
Save Hendrik44/e81168c8c06dd1c45b400f60cbc26ef9 to your computer and use it in GitHub Desktop.
Test ansible roles in centos docker container
# start container
docker run --rm --name centos7 --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro --volume=`pwd`:/etc/ansible/roles/rolename:ro geerlingguy/docker-centos7-ansible:latest
# go into container an run your playbook
docker exec -it centos7 bash
# for clean state exit from container and run:
docker stop centos7 && docker rm centos7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment