CREATNG DOCKER DYNAMIC INVENTORY USING ANSIBLE & CONFIGURING WEBSERVER INSIDE DOCKER
ARTH — Task 14.2
Task Description📄
Further in ARTH — Task 10 have to create an Ansible playbook that will retrieve new Container IP and update the inventory. So that further Configuration of Webserver could be done inside that Container.
Initially inventory file is empty
cat /root/ip.txt
Configure ansible.cfg
vim /etc/ansible/ansible.cfg
Ansible Playbook :
vim docker.yml
vim docker-web.yml
dockerip.j2 file
Task14.html file
Now let’s run the Playbook
ansible-playbook docker.yml
Container is successfully launched with name Webos.
Inventory file dynamically updated
Now we can run our docker-web.yml playbook to configure webserver inside container:
Now checking webos container:
Now the webserver has been deployed on the docker container.
So Let’s check our webpage from the browser: