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