This project demonstrates the deployment and configuration of a web server on AWS EC2 instances using Ansible. It automates the setup process, from server provisioning to deploying a success page.
Make sure you have the following installed:
.
├── inventory.ini
├── playbooks
│ └── main.yml
├── roles
│ └── software
│ ├── handlers
│ │ └── main.yml
│ └── tasks
│ └── main.yml
└── success.html
inventory.ini
: Defines the hosts (EC2 instances).playbooks/main.yml
: Main playbook for deploying and configuring the web server.roles/software
: Ansible role containing tasks and handlers.
- Clone the repository:
git clone [repo-url]
- Configure your AWS credentials using the AWS CLI.
- Update the
inventory.ini
file with your EC2 instance details. - Run the Ansible playbook:
ansible-playbook -i inventory.ini playbooks/main.yml
If you encounter issues, check the following:
- Ensure Ansible and AWS CLI are installed.
- Verify AWS credentials and EC2 instance accessibility.
- Review Ansible playbook logs for detailed information.