#!/bin/bash
sudo systemctl stop puppet.service
sudo /opt/puppetlabs/bin/puppet config set ca_server puppet-ca.liquidtelecom.net
sudo /opt/puppetlabs/bin/puppet config set server lt-hq-foreman1-za.liquidtelecom.net
sudo /opt/puppetlabs/bin/puppet config set certname $(cat /etc/hostname)

#remove all contents of following dirs
sudo rm -rf /etc/puppetlabs/puppet/ssl/*  
sudo rm -rf /var/lib/puppet/ssl

sudo /opt/puppetlabs/bin/puppet agent -t
