Dynamically pick the IP address of Docker container by Ansible
Today we will see how we can pick the dynamic IP of a docker container.
First we will create a container by ansible and pull the centos image from docker hub.
The complete playbook is
To run this playbook, use command
ansible-playbook playbook_name
After running it will prompt to ask the container name
Lets see our docker service
Now have a look at images
We have to change the debug message to
Output we get
Lets check it by running inpect command of docker
Thank You for reading.
I would like to thanks Vimal Daga Sir.
My Email — ayanchawlae@gmail.com
My LinkedIn — https://www.linkedin.com/in/ayanchawlae/
Comments
Post a Comment