Skip to content

This project uses Terraform to deploy a VPC with public and private subnets, three EC2 instances, and a load balancer, while Ansible configures servers and deploys a sample Django application with a PostgreSQL database. The setup includes roles for infrastructure installation and application deployment.

Notifications You must be signed in to change notification settings

BlessedXd/terraform_ansible_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Terraform & Ansible Project

πŸš€ Project Overview

This project leverages Terraform and Ansible to automate the deployment of infrastructure and application setup. We will deploy a sample Django application that requires a PostgreSQL database.

🌐 Infrastructure Requirements

  • VPC with public and private subnets
  • Three EC2 instances:
    • Two in the public subnet for the application
    • One in the private subnet for the database
  • Load Balancer to distribute traffic between application instances
  • Terraform should generate an inventory file for Ansible

πŸ› οΈ Ansible Roles

  1. Infrastructure Role

    • Install PostgreSQL on the database instance
    • Create a user and database
    • Install necessary software and Nginx on application instances to route traffic to the Django application
  2. Deployment Role

    • Update code from GitHub
    • Refresh configuration files with current database credentials
    • Execute database migrations

🌟 Sample Application

We will deploy the following sample Django application: Sample Django Application

πŸ”§ Getting Started

Prerequisites

πŸš€ Installation

  1. Clone the repository:
    git clone https://github.com/BlessedXd/terraform_ansible_project
  2. Navigate to the project directory:
    cd terraform_ansible_project
  3. Initialize Terraform:
    terraform init
  4. Apply the Terraform configuration:
    terraform apply
  5. Configure Ansible: Adjust inventory and configuration files as needed.

πŸŽ‰ Deploy the Application

  1. Run the Ansible playbook:
    ansible-playbook -i inventory deploy.yml
    

πŸ“œ License

This project is licensed under the MIT License.

🀝 Contributing

Contributions are welcome! Please open an issue or submit a pull request.

πŸ“¬ Contact

For questions or feedback, please reach out at [email protected]

🌟 Happy Coding! πŸš€

Feel free to customize any part of the README to better fit your style or project specifics!

About

This project uses Terraform to deploy a VPC with public and private subnets, three EC2 instances, and a load balancer, while Ansible configures servers and deploys a sample Django application with a PostgreSQL database. The setup includes roles for infrastructure installation and application deployment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages