Setting up Puppet Server in RHEL 8 / CENTOS 8
Step 1 - Add such entry in /etc/hosts | |
====================================================== | |
$ hostnamectl set-hostname puppet | |
$ vim /etc/hosts | |
20.163.145.158 puppet | |
172.173.236.231 agent1 | |
172.173.236.232 agent3 | |
Step 2 - Enable the Puppet platform on Yum | |
====================================================== | |
$ sudo rpm -Uvh https://yum.puppet.com/puppet7-release-el-8.noarch.rpm | |
$ yum install puppetserver | |
$ sudo systemctl start puppetserver | |
Step 3 - Open a new shell, or use exec bash to update your PATH | |
====================================================== | |
$ exec bash | |
$ puppetserver -v | |
$ sudo systemctl status puppetserver |
Setting up Puppet Agent in Linux
Step 1 - Add such entry in /etc/hosts | |
====================================================== | |
$ hostnamectl set-hostname agent1 | |
$ vim /etc/hosts | |
20.163.145.158 puppet | |
172.173.236.231 agent1 | |
172.173.236.232 agent3 | |
Step 2 - Enable the Puppet platform repository | |
========================================================= | |
# RHEL 8 / CENTOS 8 | |
$ sudo rpm -Uvh https://yum.puppet.com/puppet7-release-el-8.noarch.rpm | |
# RHEL 7 / CENTOS | |
$ sudo rpm -Uvh https://yum.puppet.com/puppet6-release-el-7.noarch.rpm | |
Ubuntu | |
$ wget https://apt.puppetlabs.com/puppet6-release-bionic.deb | |
$ sudo dpkg -i puppet6-release-bionic.deb | |
Step 3 - Install Puppet Agent | |
========================================================= | |
# RHEL / Centos | |
$ sudo yum install puppet-agent | |
$ systemctl status puppet | |
$ systemctl start puppet | |
$ systemctl enable puppet | |
$ systemctl status puppet | |
$ source /etc/profile.d/puppet-agent.sh | |
$ sudo /opt/puppetlabs/bin/puppet resource service puppet ensure=running enable=true | |
# Ubuntu | |
$ sudo apt-get install puppet-agent | |
$ systemctl status puppet | |
$ systemctl start puppet | |
$ systemctl enable puppet | |
$ systemctl status puppet | |
$ source /etc/profile.d/puppet-agent.sh | |
$ sudo /opt/puppetlabs/bin/puppet resource service puppet ensure=running enable=true |
Configure Puppet Agent with Server
@Puppet Agent | |
$ puppet config set server puppet --section main | |
$ puppet ssl bootstrap | |
@Puppet Server | |
$ puppetserver ca list | |
$ sudo puppetserver ca sign --certname <agent-name> | |
@Puppet Agent | |
puppet ssl bootstrap | |
puppet agent -t | |
puppet agent -t -d --trace > puppet_output.txt 2>&1 | |
# Get a debug-level log from an agent run in PE using the command line and save it to a file. | |
To get a log for an agent running on Linux and Windows, run: | |
$ puppet agent -t -d --trace > puppet_output.txt 2>&1 | |
To get a log for agent run times, run: | |
$ puppet agent -t -d --evaltrace --trace > puppet_output.txt 2>&1 | |
To get a log to troubleshoot connectivity issues with the Puppet Server, run: | |
$ puppet agent -t -d --http_debug --trace > puppet_output.txt 2>&1 |
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND