Web Server using Ansible Playbook

Configuring webserver using ansible playbook

1. Add the IP address of the target node in the folder /etc/ansible/ansible.cfg

2. Use the command 'ansible all --list-hosts' to check if the IP is added as a host.


3. Use pip install sshpass or dnf command for ssh





4. Create the file in yml extension in the main node.
And use the command 'ansible-playbook <filename.yml>'
Here, I am configuring using docker and my yml file is named as docker.yml
So, my command will be 'ansible-playbook docker.yml'





5. In the target node where we are configuring webserver, go to the terminal and check a docker container is launched or not usiong the command 'docker ps'


6. Type the command 'docker inspect <container_id> | grep IP'
It will display all the strings with the word IP in it. 
We can either use curl command along with the IP adrress and filename (or) we can use the IP_address/filename to check if the webpage is created.




Comments

Popular posts from this blog

TASK - 15