Reverse proxy On Aws With help of Ansible

In this blog we will see how we can create a load balancer setup or reverseproxy setup on Aws cloud with the help of ansible and with help on ansible we will retrive ip of ec2 instance dynamically and automate whole process.

pip3 install boto3   //assuming python3 is installed
  • Here, the RedHat system itself calls the API for configuration on AWS, and this procedure is done on the local machine that’s why the host is supposed to be localhost.
  • For authentication to the AWS account, create one IAM user that has less privileged than the root account. The AWS_ACCESS_KEY and AWS_SECRET key are passed explicitly through an Ansible so this keys either we can create a file with .boto extension we can provide key here or we can provide a var file and save our keys there .
vi ~/.botto
vi keys.yml
https://raw.githubusercontent.com/A-zish/Ansible_Ec2/master/ec2.pyhttps://raw.githubusercontent.com/A-zish/Ansible_Ec2/master/ec2.ini
chmod +x ec2.py
chmod +x ec2.ini
ansible all --list-hosts
vim /etc/ansible/ansible.cfg
ansible-playboook final.yml

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store