Ansible Playbook with dynamic inventory

Ansible Playbook for dynamically updating the inventory with the new container IP to deploy a webserver in it!

Playbook:

Running the playbook:

Inventory gets dynamically updated as we used blockinfile module and retrieved ip using ansible facts.

The inventory has been updated; the IP of our container is 172.17.0.2

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store