Skip to content

albertitauma/Ansible-EC2

Repository files navigation

Ansible-EC2

Summary: In this project I use Ansible to deploy a website on three different EC2 Instances at the same time using a playbook.


This picture shows the cloud architect layout.

_______________________________________________________________________________________________

Below shows the 2 EC2 instances running along with the Ansible master machine. image


After creating the ansible master ec2 instance, we need to ssh into it and run the ssh-keygen command to create keys that will be used to connect to the other instance we create. I made a ssh key gen on the ansible master than we needed to import the public key into the ec2 console. So, with ansible target servers created, we will add the public key to them. image


Here is the ansible inventory file listing all the ec2 target servers. image


Here I used some ansible ad hoc commands to test the connection. image


I created a playbook. The playbook YAML (ec2-play.yml) file is listen inside the repository, feel free to view. The ansible configuration file is also list above.

Here is the terminal output after running the playbook. image


Note the public IPs for the two target severs. I will paste them in browser to check if the site is up and running on both servers.

Note: All servers were terminated for security reasons.

About

Using Ansible to deploy a website on three different EC2 Instances

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages