
Photo by Intricate Explorer on Unsplash
Protecting the production environment
Methuselah
Puppet is the Methuselah among solutions for configuration management, matured for a proud 15 years and currently at version 7. In contrast to Ansible, Puppet takes a declarative approach (i.e., it describes the state of a resource and not how to achieve it).
Listing 1 declares the kermit account, which must exist and must belong to the muppets primary group. A gonzo user must not exist at the same time. Puppet must therefore be able to determine the current state and independently change it to the declared, desired state.
Listing 1
Resource Declarations
user { 'kermit': ensure => present, gid => 'muppets', } user { 'gonzo': ensure => absent, } group { 'muppets': ensure => present, }
Resource Abstraction Layer
A major role in how Puppet accomplishes this task is played by the resource abstraction layer (RAL). This core element in Puppet is also responsible for platform independence. To do this, RAL distinguishes between types and providers. A type defines the properties of a resource like a user
. These properties include parameters such as gid
, home
, or shell
. Each type must have at least one provider that describes how the current state is determined and how the desired state can be achieved. The provider
type is a metaparameter, because it is always available with every resource.
Figure 1 also shows a package
type, which is used to take care of various software packages. If more than one provider is assigned to a type, there is always a default provider, which can differ
Buy this article as PDF
(incl. VAT)
Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.
