Coder Social home page Coder Social logo

vdharmaraj / pgdo_cm_project_1 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 3.0 5.71 MB

CI/CD Deployment Using Ansible CM Tool

License: GNU General Public License v3.0

Shell 39.25% Java 60.75%
ansible jenkins ubantu tomcat-server jenkinsfile jenkins-pipeline shell-script tomcat7 servlets servlet-jsp

pgdo_cm_project_1's Introduction

PGDO_CM_Project_1

CI/CD Deployment Using Ansible CM Tool

Objective:

Solution build should demonstrate below capabilities:

  1. Configure Jenkins server as Ansible provisioning machine
  2. Install Ansible plugins in Jenkins CI server
  3. Prepare Ansible playbook to run Maven build on Jenkins CI server
  4. Prepare Ansible playbook to execute deployment steps on the remote web container with restart of the web container post deployment

Project goal is to Automate Ansible integration with Jenkins CI server so that we can run and execute playbooks to deploy custom WAR files to a web container and then perform restart for the web container.

Tools required:

Ansible, GitHub, Git, Linux (Ubuntu), Jenkins

Important Artifacts in the project

1) maven playbook file (/maven.yaml) is used to install maven and do maven build in the CI server
2) Main playbook (/main.yml) , tomcat ansible-role playbook (/roles/tomcat/tasks/main.yml) and inventory file (/inventories/dev/hosts) where managed node IPs are maintained, these are important files to deploy the java application in managed nodes
3) Jenkinsfile (/Jenkinsfile) is the jenkins pipeline script written to exeute the CI/CD in stages to do the code build and deploy the changes to the managed nodes
4) Java Web App (/src/main/webapp/) contains a simple login page webapp created with Servlets
5) POM file (/pom.xml) to do build and package the application into a WAR file
6) Shell Script (/roles/tomcat/files/tomcat-initscript.sh) to start and stop tomcat server

System Requirements

1 Master Node - With Ubantu OS and 4 GB RAM minimum - Installed with Python3, Java8, Ansible, Jenkins and Git
1..N Managed Nodes - with Ubantu OS and 4 GB RAM minimum - Python 3 installed

Changes to be done while reusing the project

1) change the hosts in the inventory file (inventories/dev/hosts)
2) In the Jenkins pipeline script file (/Jenkinsfile) , checkout stage related git clone url and branch has to be changed according to your github links.This stage in Jenkinsfile is just used for displaying the Git repository fetch.

Steps to Execute the Project:

Step 1:

Master Node should have a user called 'jenkins' after the Jenkisn Installation, this user should be configured to connect to localhost with SSH.

Step 2:

In every managed node, 'jenkins' user has to be created with root user privilege and a SSH connectivity has to be establised from master node jenkins user to managed node jenkins user

Step 3:

Install Git and Ansible addin in the Jenkins server

Step 4:

Create a Jenkins pipeline Job which is using the Jenkinsfile from this project repository, set the job trigger as Poll SCM pointing to this gihub repository

Step 5:

Test the sample login web app java application runing in the managed nodes by accessing the url http://~Managed_node_ip~:8080/LoginWebApp-1/

Project Documentation

Click [here](https://github.com/vdharmaraj/PGDO_CM_Project_1/blob/94ea3999f5bc533aa83acb38aca43017a341ea99/PG%20DO%20-%20Configuration%20Management%20with%20Chef,%20Puppet%20and%20Ansible_Project-1_Vignesh_Dharmaraj.pdf) to access the project documentation I have created to submit for my DevOps PG certification program requirements

pgdo_cm_project_1's People

Contributors

vdharmaraj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.