Hello Guys!!
It's less than 5mins to read articleThere are different situations where you need to work but you have security restrictions, you cannot even run the vagrant boxes on your laptop. In such situations, If you are able to login to Docker Hub then you can play your playbooks for testing different modules which don't need to connect remotely to your managed nodes. That means you want to execute the module on the Ansible Controller node itself.
Ansible container running on PWD (Play with Docker) |
Pre-requisites
- You must have a Docker Hub user account
- You must have basic knowledge on Docker images, containers usage
- Good internet speed :)
Steps to run Play with Docker
Step 1: Log in to your Docker Hub and launch the "Play with Docker" also known as PWD in short.
Step 2: Create the Docker installed Nodes using "ADD NEW INSTANCE".
Step 3: Search for the Ansible images either you can check at the command line with or search on the Docker Hub web page
docker search ansible
Step 4: Here I've chosen the image as 'ansible/awx', You have your own choices for your Ansible container. Pull the Docker image for Ansible
docker pull ansible/awx
Ansible image pull on Docker Host |
Step 5: After ansible/awx image pull successful you are good to go for create the ansible container. Use the following command to run the 'myawx' container.
docker run -itd --name myawx ansible/awx
Step 6: Enter into the container name 'myawx' and start playing your playbooks!!
docker exec -it -u 0 myawx /bin/bash
Docker run ansible container and ssh to it |
ansible --version
Ansible version checking |
Hope you enjoyed this post, please share to your friends it is so simple to understand and execute, you need only internet connection on your laptop!!
You might be interested to see more, This blog is having couple of ansible experiments please visit, given in the right side Content section.
No comments:
Post a Comment