Arth-Task 14.2
🔰 Ansible playbook that will retrieve new Container IP and update the inventory. So that further Configuration of Webserver could be done inside that Container.
Let’s start …
- Update the ansible Configuration file :
path : /etc/ansible/ansible.cfg
2. Create an Empty Inventory file :
The inventory should be in the location mentioned above or in any other directory but the path should be mentioned in the configuration file.
command : vim file_name.txt
3. Create a Template file with all the credential required :
4. Create a Template file for web server :
5. YML Code for retrieving container ip :
5. Now run the code :
command : ansible-playbook filename.yml
6. Check the Inventory file :
7. Check the output in the browser :
Task Completed !!
Thanks for reading !!!