Deploying Web Server on AWS through ANSIBLE.
Task2:
* Provision EC2 instance through ansible.
*Retrieve the IP Address of instance using a dynamic inventory concept.
*Configure the webserver through ansible!
Amazon Web Services:
Amazon Web Services (AWS) is a subsidiary of Amazon providing on-demand cloud computing platforms and APIs to individuals, companies, and governments, on a metered pay-as-you-go basis. These cloud computing web services provide a variety of basic abstract technical infrastructure and distributed computing building blocks and tools. One of these services is Amazon Elastic Compute Cloud (EC2), which allows users to have at their disposal a virtual cluster of computers, available all the time, through the Internet.
Steps to provision EC2 instance through ansible.
1 ). we have to set up an Ansible environment in our system. For doing anything on the aws using the local system with the help of ansible then you have to install boto library of python
2). Create ec2 instance on aws from control node.We have to write playbook as follow.
*As we can show our aws access key and secret key so we need one more new.yml file which include all keys.To create new.yml file we used:
*keys included in new.yml file as:
*To check new.yml file encrypted or not use:
3). now run launch.yml file to launch ec2 instance.
check ec2 launched or not:
Steps to retrieve the IP Address of instance using a dynamic inventory concept.
1). first we have to download python code from github using wget which fetch ip addresses
now make them executable as:
2 . To initiate these ec2.py and ec2.ini file we have to export ini file path, access key, secret key as:
3 . Now configure the inventory as py file fetch the ip by dynamic inventory concept.
4 . Check target host pinging:
Steps to configure the webserver through ansible:
1. write playbook for webserver configuration on ec2 instance as:
2. Run this playbook :
webserver has been deployed succesfully.
3 . Here our ec2-instance configure successfully, now check the web-browsers:
THANKYOU...
Great Sagar Gavhane
Excellent 🔥