Posted On October 19, 2021

Puppet Client Server Lab Setup

kimconnect 0 comments
blog.KimConnect.com >> Codes , Linux , Windows >> Puppet Client Server Lab Setup

Server

# Setup client machine name
sudo vim /etc/hosts
## Insert this line ##
xx.xx.xx.xx puppet-client.local puppet-client # this will enable client to know client with DNS
xx.xx.xx.xx puppet-server.local puppet-server 

# Install puppet
curl -O https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb 
dpkg -i puppetlabs-release-pc1-xenial.deb

# Install puppet agent
sudo apt update
sudo apt install puppet-server -y 
systemctl enable puppetserver
systemctl start puppetserver

# Configure memory allocation
vim /etc/default/pupperserver
## change this line to fit your memory allowance ##
JAVA_ARGS="-Xms2g -Xmx2g -XX:MaxPermSize=256m"

# Config firewall
sudo ufw allow 8140

Client

# Setup client machine name
sudo vim /etc/hosts
## Insert this line ##
xx.xx.xx.xx puppet-client.local puppet-client
xx.xx.xx.xx puppet-server.local puppet-server # this will enable client to reach server

# Install puppet
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb 
dpkg -i puppetlabs-release-pc1-xenial.deb

# Install puppet agent
sudo apt update
sudo apt install puppet-agent -y 
systemctl enable puppet
systemctl start puppet

Connecting Client To Server

# create cert signing request while login to client
/opt/puppetlabs/bin/puppet agent -t --server=puppet-master.local

# sign the cert signing request while login to server
/opt/puppetlabs/bin/puppet list --all # Check for existing certs and requests
/opt/puppetlabs/bin/puppet cert sign puppet-client.local # where puppet-client.local is the requesting node

# Test from client
/opt/puppetlabs/puppet/bin/puppet agent -t --server=puppet-master.local

Example of installing modules: Python

# While login to puppet-master

# set current directory as the modules folder
cd /etc/puppetlabs/code/environments/production/modules/

# search for a module from Puppet Forge
$ /opt/puppetlabs/bin/puppet module search python

# install the module we've selected
$ sudo /opt/puppetlabs/bin/puppet module install python

# Install the module to make it available to the manifest inclusions
/opt/puppetlabs/bin/puppet module install puppet-labs-python --version x.xx.x

# verify the module is installed
$ sudo /opt/puppetlabs/bin/puppet module list

# Pushing puppet image out to a client
vim /etc/puppetlabs/code/environments/production/manifests/site.pp
## Insert this content ##
node 'puppet-client.local' {
  include python
  include python::virtualenv
}

# pull the config while login to client
/opt/puppetlabs/puppet/bin/puppet agent -t --server=puppet-master.local

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: How To Configure Static IP Address

$nicName='NIC1' $ipaddress='192.168.0.222' $cidrPrefix=24 $defaultGateway='192.168.0.1' $dnsServers=@('8.8.8.8','4.4.2.2') $disableIpv6=$true function setNic($nicName,$ipAddress,$cidrPrefix,$defaultGateway,$dnsServers,$disableIpv6=$true ){ $ifIndex=(get-netadapter|?{$_.Name -eq $nicName}).ifIndex New-NetIPAddress -InterfaceIndex $ifIndex…

Install PBX in a Flash

Download and install FreePBX version 13Set static IPsifconfig <= to find interface namevim /etc/sysconfig/network-scripts/ifcfg-eth0---------ADD-----------BOOTPROTO="static"IPADDR=192.168.139.139NETMASK=255.255.255.0BROADCAST=192.168.139.255NM_CONTROLLED=noONBOOT="yes"-----------------------vim /etc/sysconfig/network-scripts/ifcfg-eth1---------ADD-----------BOOTPROTO="dhcp"ONBOOT="yes"-----------------------vim…

PowerShell: Function to Get Group Members as a Bypass Orphanated SID Errors

Problem: [TESTSERVER]: PS C:\Users\administrator> Get-LocalGroupMember 'Remote Desktop Users' Get-LocalGroupMember : Failed to compare two elements…
Other project: DragonCoin.com