Puppet Installation

 • Install Puppet Master & Agent on AWS

• Launch And Configure EC2-Instance in console

• Select Ubuntu OS 14.04

• Choose the server type

 Enter the number of servers we need to create :-I enter 2 server it

will automatically create Add the Disk

 Storage memory as per requirement

 Configure the Security Group to enable the HTTP,TCP

• Launch instances and connect using Putty

• Install Puppetmaster and Agent

Sudo -i

Hostname

hostname puppetmaster.test.org

exit

sudo -i

 Check ifconfig of agent machines and copy the IP address for agent. Run the

following command on master machine

echo <172.31.26.143> puppetagent1.test.org >> /etc/hosts

ping puppetagent1.test.org

apt-get update

apt-get install puppetmaster

puppet --version

service puppetmaster status

puppet cert list -all

• On Agent node, open terminal

Sudo -i

hostname

hostname puppetagent1.test.org

exit

sudo -i

• On master node, open terminal and run ifconfig to check the IP address

Ifconfig

• On agent node, open terminal and run following commands

echo 172.31.22.177 puppetmaster.test.org >> /etc/hosts

ping puppetmaster.test.org

apt-get update

apt-get install puppet

Service puppet status

vi /etc/puppet/puppet.conf

server=puppetmaster.test.org

Puppet agent -t

Puppet agent --enable

Puppet agent –-server puppetmaster.test.org

Puppet agent -t

• Run the following commands in agent terminal window

puppet agent –t

facter

• Run the following commands in master terminal window

puppet apply -e 'notify { "Hello World" : }'

puppet apply -e 'service {"sshd" : ensure =>"stopped", enable => false,}'

service ssh restart

• Run the following commands in master terminal window

cd /etc/puppet

ls

cd manifests

 Create a file by typing nano site.pp and edit the following code. Save and exit

node default {

notify{“The default puppet configuration”: }

}

 Go to Agent window and run the following command

puppet agent -t

 Again edit the site.pp by typing nano site.pp. Add the following code, save and exit.

node puppetagent1 {

notify{“We have matched nodes in Puppet”: }

}

 Go to Agent window and run the following command

puppet agent -t

 Again edit the site.pp by typing nano site.pp. Update the previous code with the following code, save and exit. This will match all the nodes that have the words “puppet” in their name.

node /^puppet/ {

notify{“We have matched nodes in Puppet”: }

}

 Go to Agent window and run the following command

puppet agent -t

 Go to puppetagent1 client terminal and run the following commands

cd /var/lib/puppet

ls -l

cd client_data/catalog

ls -l

more puppetagent1.test.org.json


Comments

Popular posts from this blog

Terraform

Scrum Master Interview help - Bootcamp

Kubernetes