Puppet
→ puppet.com
Learn
Puppet is a solution to automate the management of an infrastructure, it is an open source product with an important community. Current version is 6.3 (February 2019). An enterprise edition is available with additional features that ease the use of the solution.
Entry points:
Architecture
Puppet is relying on the agent-master pattern:
An agent node sends a requests (with
facts
) to the master and asks for the desired state (catalog
)The master checks the node is known (and the communication is secured with HTTPS/certificate) and sends back the catalog based on its data repository (including the code to achieve the different configurations)
The agent applies the catalog and reports back the result of the actions
The Puppet master is also known as the puppetserver
.
Modules
Puppet Forge
Puppet is modular by design, first step is to look at existing modules for your needs (NB: don't reinvent the wheel and keep you code on added value). Module repository is Puppet forge at forge.puppet.com.
Interesting modules:
Name
Detail
Source
puppet-archive
Compressed archive file download and extraction with native types/providers for Windows and Unix
puppet-download_file
puppetlabs-acl
puppet-windows_env
puppetlabs-powershell
puppetlabs-registry
Manage IIS for Windows Server 2008R2, 2012 and 2012R2. Maintain application sites, pools, installation, and many other IIS settings.
Module creation
Pipeline
PDK (Puppet Development Kit)
Bolt
Tasks
r10k
Training
Puppet (Course Catalog)
Azure
Usecases
Docker
On Windows, edit the two files:
Practice
Unit testing
Documentation
Files
.fixture.yml
file is where you can declare dependencies with other modules
Puppet agent
Installation on Windows
Go to Download page and select the version that you need (puppet-agent-x64-latest.msi
for example).
Configuration files (Windows)
File path
Details
C:\Windows\System32\drivers\etc\hosts
Host file
C:\Users\xxxxxxx\.gitconfig
Git configuration file
C:\ProgramData\PuppetLabs\puppet\etc\puppet.conf
Puppet agent configuration file
C:\ProgramData\PuppetLabs\puppet\etc\ssl
Puppet client ssl
Directory structure (Windows)
C:\ProgramData\PuppetLabs\code\environments
: local copy of environment files
Agent commands
Puppet server
It is also known as Puppet master. You can review the procedure to install a Puppet server on this page.
Server commands (CentOS)
Configuration files (doc)
File path
Details
/etc/sysconfig/puppetserver
Puppet server configuration file
/etc/puppetlabs/puppetserver/conf.d/auth.conf
Puppet serveur auth configuration file (doc)
/etc/puppetlabs/puppet/puppet.conf
Puppet agent configuration file
/etc/puppetlabs/puppet/hiera.yaml
Hiera configuration file (doc)
/etc/puppetlabs/r10k/r10k.yaml
r10k configuration
Directory structure
/etc/puppetlabs
: base path/etc/puppetlabs/code
: Puppet code managed by git, this is where r10k will/etc/puppetlabs/code/environments
: Definition per environment, this is where r10k will create folders per git repository branches (production, staging, etc.)/etc/puppetlabs/puppet
: Puppet Agent configuration/etc/puppetlabs/puppetserver
: PuppetServer configuration/etc/puppetlabs/puppetserver/conf.d
: Settings (see Puppet Server Configuration)/etc/puppetlabs/r10k
: r10k configuration/opt/puppetlabs
: Internal Puppet stuff, binaries, etc/var/log/messages
: Puppet Agent logs/var/log/puppetlabs
: Other logging/tmp
: Used by the installer (issues if set ‘noexec’)
You can read Magic directories: a guide to Puppet directory structure.
Terminology
r10k puppet.com
Last updated