From 860ea5c08b4549ea591d602cd69ac06360e2ca89 Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Thu, 19 Dec 2019 16:28:51 -0500 Subject: [PATCH 1/2] Fix formatting for the `ansible` command examples and add bash shell example. --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e580126..34a6eaf 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,19 @@ This image is built on Docker Hub automatically any time the upstream OS contain 1. [Install Docker](https://docs.docker.com/engine/installation/). 2. Pull this image from Docker Hub: `docker pull geerlingguy/docker-centos7-ansible:latest` (or use the image you built earlier, e.g. `centos7-ansible:latest`). 3. Run a container from the image: `docker run --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro geerlingguy/docker-centos7-ansible:latest` (to test my Ansible roles, I add in a volume mounted from the current working directory with ``--volume=`pwd`:/etc/ansible/roles/role_under_test:ro``). - 4. Use Ansible inside the container: - a. `docker exec --tty [container_id] env TERM=xterm ansible --version` - b. `docker exec --tty [container_id] env TERM=xterm ansible-playbook /path/to/ansible/playbook.yml --syntax-check` + 4. Use commands such as `ansible` and `ansible-playbook` inside the container: + + ``` + # Run `ansible --version` + docker exec --tty [container_id] env TERM=xterm ansible --version` + + # Run `ansible-playbook /path/to/ansible/playbook.yml --syntax-check` + docker exec --tty [container_id] env TERM=xterm ansible-playbook /path/to/ansible/playbook.yml --syntax-check` + + # Enter a shell in the container. + docker exec --tty [container_id] env TERM=xterm bash + + ``` ## Notes From ce7925c884282e58c17d89cd214059f8dcf130d3 Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Thu, 19 Dec 2019 16:30:22 -0500 Subject: [PATCH 2/2] Add the interactive flag (-i) to the README example. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34a6eaf..cf55b49 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ This image is built on Docker Hub automatically any time the upstream OS contain docker exec --tty [container_id] env TERM=xterm ansible-playbook /path/to/ansible/playbook.yml --syntax-check` # Enter a shell in the container. - docker exec --tty [container_id] env TERM=xterm bash + docker exec --tty -i [container_id] env TERM=xterm bash ```