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

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Choosing a New Software Vendor: The Six Critical Steps to Know and The One Everyone Forgets

“If it turns out that this is incurable, would you marry me?”

Advanced Retrofit2 (Part 1): Network Error Handling & Response Caching

What exactly does the CSS position property do?

Reviewing online tech courses: Git, Command Line, Google Analytics

Vegan Niche, a Ruby on Rails Application

Python Programming Language

sou

Most underrated — yet most useful pages in your app

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
Aakash Bhardwaj

Aakash Bhardwaj

More from Medium

Docker Network Drivers Overview | Networking in Docker #3

Automated MariaDB Replication using Docker

Configure a local Jenkins instance

Setup GitLab runner on AWS-ec2