Puppet Class Doc
Puppet Class Doc
What is Puppet?
Puppet is a configuration management tool available as an
open-source and enterprise versions. It runs on many Unix based
systems as well as on Windows.
Node2 Puppet
Data
Agent | Facter
Puppet Architecture Components?
Puppet Master
Puppet master is a service runs on the main server which
used to manage the entire clients to deploy, configure and
maintains the infrastructures.
Puppet Architecture Components?
Puppet Agent
Puppet master is a service which runs on the client sends the
request the catalog to the puppet master and applies it by
checking each resource the catalog describes. If it finds any
resources that are not in their desired state, it makes any
changes necessary to correct them.
After applying the catalog, the agent submits a report to the
Puppet master.
Puppet Architecture Components?
Catalog
A catalog is a document the describes the desired system
state for one specific server. It lists all of the resources that
need to be managed, as well as any dependencies between
those resources.
Puppet Architecture Components?
Manifests
Manifests are files with extension “.pp”, where we declare all
resources to be checked or to be changed. Resources may
be files, packages, services and so on.
Puppet Architecture Components?
Resources Types
type (package, service, file, user, mount, exec)
Title (how the resources types are called and referred)
Puppet Architecture Components?
Sample syntax
type { ‘title’:
argument => value,
other_arg => value,
}
Samples of Resources
Verify the openssh package
package { ‘openssh’:
ensure => present,
}
Samples of Resources
Create a /etc/devops file
file { ‘devops’:
path => /ect/devops,
}
Samples of Resources
Start httpd service
service { ‘httpd’:
ensure => running,
Enable => true,
}
Samples of Resources
Use below command
puppet describe --list
Classes
class mysql (
root_password => ‘defautl_value’,
port => 3306,
)
{
package { ‘mysql-server’:
ensure => present,
}
Service { ‘mysql’:
ensure => running,
}
}
How the puppet connections are getting established between puppet
master and puppet agent node?
Node2
Puppet
Master
yum -y install
http://yum.puppetlabs.com/puppetlabs-release-el-
Puppet
Master
7.noarch.rpm
Node
Install Step by Step
● Install required package on the master server
vi /etc/puppet/puppet.conf
Puppet
Master [main]
dns_alt_names = master master.sans.lan
certname = master
[agent]
:wq
Install Step by Step
● Generate the certificate in Master
Puppet
Master
Install Step by Step
● Start puppet service and enable
vi /etc/puppet/puppet.conf
[main]
Node
[agent]
server = puppet.sans.lan
:wq
Install Step by Step
● Generate the signing request certificate from the
puppet agent node client.
puppet agent -t
Node
Install Step by Step
● sign the certificates to be signed from the puppet
master node master
puppet cert list
Node