Basic Puppet
- Puppet - Facter & Facts
- Puppet - File Server
- Puppet - Module
- Puppet - Manifest Files
- Puppet - Coding Style
- Puppet - Validating Setup
- Installing & Configuring r10K
- Puppet - SSL Sign Certificate Setup
- Puppet - Agent Setup
- Puppet - Master
- Puppet - Environment Conf
- Puppet - Configuration
- Puppet - Installation
- Puppet - Architecture
- Puppet - Overview
Advanced Puppet
- Puppet - Live Project
- Puppet - RESTful API
- Puppet - Type & Provider
- Puppet - Environment
- Puppet - Custom Functions
- Puppet - Function
- Puppet - Classes
- Puppet - Template
- Puppet - Resource Abstraction Layer
- Puppet - Resource
Puppet Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Puppet - Configuration
Once we have Puppet installed on the system, the next step is to configure it to perform certain initial operations.
Open Firewall Ports on Machines
To make the Puppet server manage the cpent’s server centrally, one needs to open a specified port on all the machines, i.e. 8140 can be used if it is not in use in any of the machines which we are trying to configure. We need to enable both TCP and UDP communication on all the machines.
Configuration File
The main configuration file for Puppet is etc/puppet/puppet.conf. All the configuration files get created in a package-based configuration of Puppet. Most of the configuration which is required to configure Puppet is kept in these files and once the Puppet run takes place, it picks up those configurations automatically. However, for some specific tasks such as configuring a web server or an external Certificate Authority (CA), Puppet has separate configuration for files and settings.
Server configuration files are located in conf.d directory which is also known as the Puppet master. These files are by default located under /etc/puppetlabs/puppetserver/conf.d path. These config files are in HOCON format, which keeps the basic structure of JSON but it is more readable. When the Puppet startup takes place it picks up all .cong files from conf.d directory and uses them for making any configurational changes. Any changes in these files only takes place when the server is restarted.
List File and Settings File
global.conf
webserver.conf
web-routes.conf
puppetserver.conf
auth.conf
master.conf (deprecated)
ca.conf (deprecated)
There are different configuration files in Puppet which are specific to each component in Puppet.
Puppet.conf
Puppet.conf file is Puppet’s main configuration file. Puppet uses the same configuration file to configure all the required Puppet command and services. All Puppet related settings such as the definition of Puppet master, Puppet agent, Puppet apply and certificates are defined in this file. Puppet can refer them as per requirement.
The config file resembles a standard ini file wherein the settings can go into the specific apppcation section of the main section.
Main Config Section
[main] certname = Test1.vipin.com server = TestingSrv environment = production runinterval = 1h
Puppet Master Config File
[main] certname = puppetmaster.vipin.com server = MasterSrv environment = production runinterval = 1h strict_variables = true [master] dns_alt_names = MasterSrv,brcleprod01.vipin.com,puppet,puppet.test.com reports = puppetdb storeconfigs_backend = puppetdb storeconfigs = true environment_timeout = unpmited
Detail Overview
In Puppet configuration, the file which is going to be used has multiple configuration sections wherein each section has different kinds of multiple number of settings.
Config Section
Puppet configuration file mainly consists of the following config sections.
Main − This is known as the global section which is used by all the commands and services in Puppet. One defines the default values in the main section which can be overridden by any section present in puppet.conf file.
Master − This section is referred by Puppet master service and Puppet cert command.
Agent − This section is referred by Puppet agent service.
User − It is mostly used by Puppet apply command as well as many of the less common commands.
[main] certname = PuppetTestmaster1.example.com
Key Components of Config File
Following are the key components of Config file.
Comment Lines
In Puppet, any comment pne starts with (#) sign. This may intend with any amount of space. We can have a partial comment as well within the same pne.
# This is a comment. Testing = true #this is also a comment in same pne
Settings Lines
Settings pne must consist of −
Any amount of leading space (optional)
Name of the settings
An equals = to sign, which may be surrounded by any number of space
A value for the setting
Setting Variables
In most of the cases, the value of settings will be a single word but in some special cases, there are few special values.
Paths
In configuration file settings, take a pst of directories. While defining these directories, one should keep in mind that they should be separated by the system path separator character, which is (:) in *nix platforms and semicolons (;) on Windows.
# *nix version: environmentpath = $codedir/special_environments:$codedir/environments # Windows version: environmentpath = $codedir/environments;C:ProgramDataPuppetLabscodeenvironment
In the definition, the file directory which is psted first is scanned and then later moves to the other directory in the pst, if it doesn’t find one.
Files and Directories
All the settings that take a single file or directory can accept an optional hash of permissions. When the server is starting up, Puppet will enforce those files or directories in the pst.
ssldir = $vardir/ssl {owner = service, mode = 0771}
In the above code, the allowed hash are owner, group, and mode. There are only two vapd values of the owner and group keys.
Advertisements