DevOps(Day-30) : End-to-End automation for Setup Web-Server using jenkins/Ansible (part-1)

CI/CD Deployment Using Ansible CM Tool


In this blog, we will explore the CI/CD process using Jenkins and Ansible. We will deploy the sample java application using Ansible on the tomcat servers. At last,this process will help us in achieving continuous integration and continuous deployment for your application.

We have make the project on master node

Jenkins is a javabased program. So to install Jenkins we have to first install Java-11, then Jenkins.

Install java:

\=============================

sudo apt install default-jre -y

Install jenkins:

curl -fsSL pkg.jenkins.io/debian-stable/jenkins.io-202.. | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null

echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null

sudo apt-get update

sudo apt-get install jenkins -y

sudo systemctl start Jenkins

Now we have to move to lab desktop to visit Jenkins official page “localhost8080”.

Jenkins set up

So here comes our Jenkins

Here Jenkins is ready to use now.

Now we have to set up Install Ansible plugins in Jenkins CI server.

we have to go to manage Jenkins.

Manage Jenkins--> plugins --> available plugins --> Search for plugin Ansible>> click on install without restart.

Now we have to configure ansible tools.

Configure ANsible tool in Jenkins

Manage Jenkins--> Configure Tools --> Scroll down to find Ansible --> Add ansible--> give name as myansible-->give path as /usr/bin

Playbook to install maven and docker

Now we are going to run the playbook

Comments

Popular posts from this blog

DevOps(Day-97): Meta-Arguments in Terraform

DevOps(Day-95): Auto Scaling with Terraform

DevOps (Day-1) Introduction