Skip to content

alaa-alshitany/Project_DevOps_Tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Task-on-terraform-jenkins-ansible-docker-AWS

πŸ“ Overview

This project focuses on automating the end-to-end infrastructure provisioning and deployment process on AWS. By integrating Jenkins for orchestration, Terraform for managing infrastructure as code (IaC), and Ansible for configuration management, it establishes a robust CI/CD pipeline.

This pipeline automates the creation and configuration of infrastructure, ensuring efficient and reliable deployment of applications. The aim is to enhance operational efficiency and streamline the deployment process through automation and IaC principles.


πŸš€ Key Features

  • Infrastructure as a Code (IaC) using Terraform
  • CI/CD Orchestration using Jenkins
  • Configuration Management using Ansible
  • Cloud Provider: AWS
  • Containerization using Docker

πŸ“‹ Prerequisites

  • AWS account with S3 bucket and dynamodb table.

  • Initialize the remote backend. Terraform/backend.tf

  • Make 2 Ansible Roles:

  • Create 2 ec2 on your AWS account to be (jenkins master & Slave) Screenshot from 2024-05-20 01-26-50

    Screenshot from 2024-05-20 01-18-48


πŸ“œ Main Steps

  1. Create jenkins pipeline to run terraform Code Screenshot from 2024-05-20 01-59-29

Screenshot from 2024-05-20 01-59-35

Screenshot from 2024-05-20 02-53-54


  1. Configure Ansible to run over private IPs through Bastion
[application]
10.0.3.132 ansible_user=ubuntu ansible_ssh_private_key_file=../Terraform/key.pem ansible_ssh_common_args='-o ProxyCommand="ssh -W %h:%p -i ../Terraform/key.pem ubuntu@54.154.222.120"'

  1. Write Ansible script to configure EC2 to run as Jenkins slaves Screenshot from 2024-05-26 10-19-37

Screenshot from 2024-05-26 10-19-46


  1. Configure Slave in Jenkins Dashboard (with private ip) Screenshot from 2024-05-26 10-39-18

Screenshot from 2024-05-26 10-39-38

Screenshot from 2024-05-26 10-46-57

Screenshot from 2024-05-26 23-13-02

Screenshot from 2024-05-26 14-52-19

Screenshot from 2024-05-26 14-52-31


  1. create pipeline to deploy nodejs_example fro branch (rds_redis)

Screenshot from 2024-05-26 15-14-06

Screenshot from 2024-05-26 17-41-19


  1. Add application load balancer to your terraform code to expose your nodejs app on port 80 on the load balancer Terraform/loadBalancer.tf

βœ… Test the Application

Screenshot from 2024-05-26 18-10-22

Screenshot from 2024-05-26 20-51-39

About

Project on Docker, Terraform, Jenkins, Ansible

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published