This guide will help you set up a Puppet Master and Puppet Agent (or Puppet Node) on Amazon Web Services (AWS) using straightforward commands. This setup allows you to manage configurations and automate tasks on your nodes using Puppet.
MY Video link:- https://www.youtube.com/watch?v=bMBue_LOW7g&t=578s
sudo nano /etc/hosts
Add the following line:
<Puppet_Master_Private_IP> puppet
curl -O https://apt.puppetlabs.com/puppet6-release-bionic.deb
sudo dpkg -i puppet6-release-bionic.deb
sudo apt-get update
sudo apt-get install puppetserver -y
sudo nano /etc/default/puppetserver
JAVA_ARGS = "-Xms512m -Xms512m"
sudo ufw allow 8140
sudo systemctl enable puppetserver.service
sudo systemctl start puppetserver.service
sudo systemctl status puppetserver.service
sudo nano /etc/hosts
Add the following line:
<Puppet_Master_Private_IP> puppet
curl -O https://apt.puppetlabs.com/puppet6-release-bionic.deb
sudo dpkg -i puppet6-release-bionic.deb
sudo apt-get update
sudo apt-get install puppet-agent -y
sudo systemctl enable puppet
sudo systemctl restart puppet
sudo systemctl status puppet
sudo /opt/puppetlabs/bin/puppetserver ca list
sudo /opt/puppetlabs/bin/puppetserver ca sign --certname <Agent_CertName>
sudo nano /etc/puppetlabs/code/environments/production/manifests/site.pp
Add content like the following example:
file { '/tmp/puppet_test.txt':
ensure => present,
mode => '0644',
content => "Hello from Puppet master (Welcome to puppet testing with vishal.) to agent on IP address ${ipaddress_eth0}\n",
}
sudo /opt/puppetlabs/bin/puppet agent --test
sudo cat /tmp/puppet_test.txt
Congratulations! Your Puppet Master and Puppet Agent are now set up and running. You've tested the configuration to ensure everything is working smoothly.
Happy learning!