Ansible playbook that will retrieve new Container IP and update the inventory. So that further Configuration of Web-server could be done inside that Container.

Samkit Shah
3 min readMar 29, 2021

--

For this setup there are several ways to configure this but I set an OS image and then setting up ssh in that image.

The requirements for ssh packages are : openssh-clients, openssh-server, net-tools and passwd.

Now we will set a root passwd and then we will commit this image and save it as tar file to send it to the target node.

Now we can see that ssh-keygen has been created.

Now, we will create a new playbook for setting up a new docker from our created image of ssh configured. And run httpd service on our docker OS.

Now, we will run our Ansible playbook.

We can now see that our Ansible playbook has successfully run.

And our inventory has been successfully updated with the docker IP.

--

--

Samkit Shah
Samkit Shah

Written by Samkit Shah

Machine Learning | Deep Learning | DevOps | MLOps | Cloud Computing | BigData

No responses yet