0% found this document useful (0 votes)
60 views5 pages

Steps On Puppet Master: Puppet Environment Structure: Manifest

This document outlines the directory structure and steps to configure Puppet's environment and manifests on the Puppet master server. It describes creating modules, manifests, and hiera data to define roles and classes for installing Git and Apache on an agent node. Key steps include generating modules, manifests, and hiera files in specific directories; configuring the site.pp to include classes from hiera; and restarting services to trigger an agent run and install packages.

Uploaded by

Vinay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views5 pages

Steps On Puppet Master: Puppet Environment Structure: Manifest

This document outlines the directory structure and steps to configure Puppet's environment and manifests on the Puppet master server. It describes creating modules, manifests, and hiera data to define roles and classes for installing Git and Apache on an agent node. Key steps include generating modules, manifests, and hiera files in specific directories; configuring the site.pp to include classes from hiera; and restarting services to trigger an agent run and install packages.

Uploaded by

Vinay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Puppet environment structure: Manifest

Hierarchy that to be followed for creating a structure to execute site.pp file:


( should be followed in the puppetmaster server)

Steps on Puppet master


/etc/puppet/modules/ * (follow the below structure)

Execute this command which is taken from https://forge.puppet.com/Aethylred/git

# puppet module install Aethylred-git


# puppet module install Aethylred-git --version 0.3.1
# cd /etc/puppet/modules

Note: * this with download the git under the module

Create a directory structure


# mkdir -p /etc/puppet/modules/profile/manifests
# cd /etc/puppet/modules/profile/manifests

Create git.pp file


→ /etc/puppet/modules/profile/manifests # vi git.pp

Under modules: /profile/manifests (create git.pp here)

Example:

class profile::git {

include ::git
}

Now Create a new file roles/manifests


→ mkdir -p /etc/puppet/modules/role/manifests

Under modules: /role/manifests (create scm.pp here)


Example:

class role::scm
{
include ::profile::git
}

Create hiera file

→ /etc/puppet/ # vi hiera.yaml

Under: /etc/puppet/ ( create hiera.yaml here)


Example:

---
? !ruby/symbol backends
:
- yaml
? !ruby/symbol hierarchy
:
- scm
? !ruby/symbol yaml
:
? !ruby/symbol datadir
: /etc/puppet/hieradata
---
:backends:
- yaml
:yaml:
:datadir: "/etc/puppet/hieradata"
:hierarchy:
- scm
Install puppet-lint ---- to check paths of manifest

Create hiera file directory


→ # mkdir -p /etc/puppet/hieradata

cd hieradata
vi scm.yaml

Under: /etc/puppet/hieradata (create scm.yaml)


Example:
---
classes:
- "role::scm"

Create a site.pp
→# cd /etc/puppet/manifests
vi site.pp

Under : /etc/puppet/manifests (create site.pp)


Example:


node "puppetagent-1.test.org" {
hiera_include('classes')

# package { 'git':
# name => 'git',
# ensure => installed,
#}
}

To check Yamal code standards ----- o wesit www.yamallint.com

Copy all yamal code and paste in that site then click on go - it check any syntax errors .
If there is wrong it correct and display --- how it show i show in video.
Steps For Puppet agent
# puppet agent -t

It collect the information site.pp

Execute the following command in puppetmaster:


# service puppetmaster restart
# puppet parser validate site.pp
Execute the following command in puppet agent:
#service puppet restart
# puppet agent -t

Tree :

# /etc/puppet/modules/ Profiles/manifest/git.pp

role/ manifest/scm.pp

#/etc/puppet/ hiera.yaml

hieradata/scm.yaml
# /etc/puppet/manifests/site.pp

Now Install the apache2 on agent node


https://forge.puppet.com/example42/apache --- download link

# puppet module install example42-apache --version 2.1.13 --- master puppet


Modify the git.pp
→ vi /etc/puppet/modules/profile/manifests/git.pp

On puppet agent

http://www.unixarena.com/2016/02/puppet-manifest-example-updating-files-on-agent-
nodes.html

http://www.yamllint.com/

https://forge.puppet.com/Aethylred/git

https://forge.puppet.com/example42/apache

You might also like