Puppet

From Leo's Notes
Revision as of 17:05, 15 June 2018 by Leo (talk | contribs) (initial)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This page was last edited on 15 June 2018, at 17:05.

Puppet is a configuration management tool that is used to configure and ensure your machines are in a consistent state.

Installation

Installing puppet can be done through your distro's package manager.

Quick Start

Puppet can be used as a standalone tool to apply manifests (.pp files defining a particular configuration state) on a machine or it can be used in conjunction with a puppet master to retrieve manifests from a remote server.

Manifests are written in DSL, Puppet's Domain Specific Language and looks something like:

# cat hosts.pp
file { "/etc/hosts":
	path => "/etc/hosts",
	source => puppet:///linux/hosts,
	mode => '0644',
}
## Apply a manifest by running:
# puppet apply hosts.pp

.

Complex manifests should be grouped together into a class. Classes are logical groupings of manifests and resources.

Terminology

There are a few differences in the terminology between puppet and other configuration management tools such as SaltStack.

  • Nodes - The machines receiving configurations. (eg. Salt Minions)
  • Facts - Facts about the nodes, such as hardware and software versions installed. (eg. Salt grains)
  • Puppet Master - The server that nodes receive configuration information from. (eg. Salt Master)
  • Puppet DB - Acts as a puppet data warehouse for information about nodes.
  • Master of Masters - Multi-levels of puppet masters for larger installations, where a puppet master is controlled by another puppet master.
  • DSL - The Domain Specific Language used by puppet configs. (eg. Yaml)
  • Manifest - A file containing specific configuration states a node should be in. (eg. Salt states)
  • Class - A class is a grouping of manifests.
  • Module - A module contains a class as well as supporting files such as templates, files, etc. One can be created by running puppet module generate module-name.