0% found this document useful (0 votes)
70 views4 pages

Commands

This document provides instructions for installing and configuring Puppet master and agent, installing Jenkins, and configuring Jenkins to deploy artifacts to a Tomcat server. It outlines steps to install Puppet server on CentOS and configure a Puppet agent. It also describes how to install Java, Jenkins, and Tomcat, and configure Jenkins to deploy builds to Tomcat for automatic deployment.

Uploaded by

pavan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views4 pages

Commands

This document provides instructions for installing and configuring Puppet master and agent, installing Jenkins, and configuring Jenkins to deploy artifacts to a Tomcat server. It outlines steps to install Puppet server on CentOS and configure a Puppet agent. It also describes how to install Java, Jenkins, and Tomcat, and configure Jenkins to deploy builds to Tomcat for automatic deployment.

Uploaded by

pavan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Links:

1: https://www.puppet.com/docs/puppet/8/install_puppet.html#install_puppet

2: https://www.virtualbox.org/wiki/Downloads

3: https://www.osboxes.org/

4: https://www.puppet.com/docs/puppet/5.5/ssl_regenerate_certificates.html#task-
3367

===================== Commands ======

--------------------------- Install Master -------------


hostname
ifconfig -a /// ip addr show

172.31.46.196

Modify:
vi /etc/hosts
172.31.46.196 puppetmaster.example.com puppet

Set the hostname:


hostnamectl set-hostname puppetmaster.example.com

Chek the F/W status:


systemctl status firewalld ----> CentOS
sudo ufw status ----> Ubuntu

Enable the repo:


wget https://apt.puppet.com/puppet7-release-focal.deb
sudo dpkg -i puppet7-release-focal.deb

Red Hat operating systems: yum install puppetserver


Debian and Ubuntu operating systems: apt-get install puppetserver

update: PATH
bash -l
puppetserver -v

sudo systemctl start puppetserver


systemctl status puppetserver
systemctl enable puppetserver
=================================================

Installation of client

Step # 1: Install the client


All the steps remain same, you need to install puppet agent:

sudo apt-get install puppet-agent

Configure the clinet:


Configuration at client:
cd /etc/puppetlabs/puppet
vi puppet.conf

[main]
certname = puppetagent1.example.com
server = puppetmaster.example.com

started the service

ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet -----> creation of Sym-link


systemctl start puppet
systemctl status puppet
ystemctl enable puppet

We went to master: Who is your client


------------------------------------------
puppetserver ca sign --certname puppetagent2.example.com

Certificate autorization in puppet

Checkit master or polling the master:


-----------------------------------------

PupppetC $ puppet agent -vt


Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for puppetagent1.example.com
Info: Applying configuration version '1690649613'
Notice: Applied catalog in 0.01 seconds
PupppetC $

================ LAB ======

Master:
---------
cd /etc/puppetlabs/code/environments/production/manifests

vi user.pp ----> puppet program

user { 'test':
ensure => present,
}

========================== Jenkins ==================


https://www.jenkins.io/doc/book/installing/linux/#debianubuntu

Installation of Java
java -version
sudo apt update
sudo apt install openjdk-11-jre
java -version

Debian/Ubuntu
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]
https://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

Start Jenkins
sudo systemctl start jenkins
sudo systemctl status jenkins
sudo systemctl enable jenkins

Access Jenkins
http://localhost:8080
sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Setting the Java_Home

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
echo $PATH

https://github.com/discover-devops/JenkinsMaven

Installing TOMCAT
-------------------

Step 1: Install Java

sudo apt-get update


sudo apt-get install default-jdk

========================
Step 2: Install Tomcat

sudo apt install unzip wget

cd /tmp

wget https://downloads.apache.org/tomcat/tomcat-8/v8.5.91/bin/apache-tomcat-
8.5.90.zip.sha512
https://downloads.apache.org/tomcat/tomcat-8/v8.5.91/bin/apache-tomcat-
8.5.91.zip.asc

unzip apache-tomcat-*.zip
sudo mkdir -p /opt/tomcat
sudo mv apache-tomcat-8.5.89 /opt/tomcat/

===========================

Step 3: Change Tomcat Server Port

Jenkins is running on Port 8080, and tomcat defalut port is also 8080. So we need
to change the Tomcat port:
Let's make the PORT number of TOmcat to 9000
cd /opt/tomcat/apache-tomcat-8.5.89/conf/
vi server.xml file

Search for Connector and change the Port Value, save the file.

8080 ----> 9090

===========================
Step 4: Change Permission of Scripts in /bin

cd /opt/tomcat/apache-tomcat-8.5.89/bin
ls -la
sudo chmod +x *

./startup.sh
./shutdown.sh
=========================

Step 6: Configure Jenkins with Tomcat for Auto Deployment of Artifacts.

Set Credentials of Tomcat that Jenkins use.

cd /opt/tomcat/apache-tomcat-8.5.89/conf

update tomcat-users.xml file.

<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-script,manager-gui"/>

=====================
Step 6 : Restart the tomcat server

/opt/tomcat/apache-tomcat-8.5.47/bin/shutdown.sh
/opt/tomcat/apache-tomcat-8.5.47/bin/startup.sh

Login Jenkins:
=================

Install Plugins:
Copy Artifact
Deploy to container

/opt/tomcat/apache-tomcat-8.5.90/webapps/manager/META-INF
context.xml

<!--
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
-->

/opt/tomcat/apache-tomcat-8.5.47/bin/shutdown.sh
/opt/tomcat/apache-tomcat-8.5.47/bin/startup.sh

You might also like