In this article, I will demonstrate How we can setup Security Group & EC2 Instance on AWS using Ansible Scripting Automation. Also, I will show how to create your own customized Roles on Ansible. Finally, we will configure HTTPD Web Server on that EC2 Instance using Ansible Role.

Let’s see the Problem Statement :

Deploy Web Server on AWS through ANSIBLE!

  1. Provision EC2 instance through ansible.
  2. Retrieve the IP Address of instance using a dynamic inventory concept.
  3. Configure the webserver through ansible.
  4. Create a role for the webserver to customize the Instance and deploy the webpage to the root directory.

Note: Complete process has to be automated.

Summary: One-Click Instance Launched and Web Server Deployed!

Pre-requisite :

This task is a little bit tricky and there are few things we need to know beforehand to perform this task. Let’s see those pre-requirements…

  • Basic knowledge of AWS is required. In this article, I will show how to provision Security Group and EC2 Instance. But **I will not show how to create EC2 key-pair and User in IAM service. **So, before starting we should make sure that we have respective “aws-access-key”, “aws-security-key” and EC2 pem format key on our local system.
  • Basic knowledge of the Ansible Playbook is required. In this article I will talk about Ansible Roles in detail. In my previous article, I talked about Ansible Playbook with examples in detail. **If you want you can check out on the below-mentioned link. **Also, I had shown how to install the Ansible program on your local system so that’s also one important requirement.

#cloud #automation #aws #ansible #devops

Configuring Web Server on EC2 Instance Using Ansible in One Click
1.70 GEEK