Table of contents
1.
Introduction
2.
Upgradation Concept in Puppet
2.1.
Upgrade PuppetServer
2.2.
Upgrade PuppetDB
2.3.
Upgrade Puppet Agents
3.
Frequently Asked Questions
3.1.
Describe Puppet Reports.
3.2.
Mention a few features of Puppet.
3.3.
Explain Puppet Production Environment.
3.4.
List the Operating Systems for which Puppet is available.
4.
Conclusion
Last Updated: Mar 27, 2024
Medium

Upgradation Concept in Puppet

Author Rupal Saluja
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Besides managing servers, Puppet performs other paramount functions that have led to its popularity. Whether it be dynamic scaling up and scaling down of machines, facilitating central modifications, or providing unique configuration to every user, Puppet does it all. It has automated several complex perks of building a project that requires skilled understanding and complex codes.

To get started with Puppet, visit Installing and Configuring Puppet Enterprise.

Context of Introduction

In this article, we will discuss Puppet's Upgradation concept and its various aspects in detail.

logo of puppet

Must Recommended Topic, Types of Agents in Artificial Intelligence.

Upgradation Concept in Puppet

As the name suggests, the upgradation concept will deal with the upgradation of every aspect of Puppet. This includes its infrastructure components, agents, and nodes. The precedence in which you upgrade the components is important.

notion of upgrading

PuppetServer and PuppetDB are upgraded parallelly along with the puppetdb-termini package on Puppet Server nodes. These components are always upgraded before you upgrade agent nodes. Ensure that you do not run different major versions on your Puppet primary servers and PuppetDB nodes. It may lead to errors.

Note that you have to restart the puppetserver every time you upgrade the puppet-agent package. Now, we will discuss each of these components sequentially in detail.

Upgrade PuppetServer

A user always has the option to add newer features and functionalities by upgrading puppetserver packages. Upgrading puppetserver packages successfully can upgrade the Puppet Server automatically. The puppetserver package is dependent on the puppet-agent package. So, the node’s package manager automatically upgrades puppet-agent in case the new version of the puppetserver requires it.

first module of upgradation concept

Note that during upgradation, the puppet server does not perform its general activities. So, if you have a single primary server, plan the timing of your upgrade accordingly. During that time, avoid reconfiguring any managed servers until your primary server is backed up. If you are using multiple servers, update them separately to avoid issues.

To upgrade the PuppetServer, follow these steps.

1. Run the following command on the Puppet Server node of your package installer.

Yum:

yum update puppetserver

 

Apt:

apt-get update
apt-get install --only-upgrade puppetserver

 

2. Remove those pins if you have used pins to mark Puppet packages to a specific version.

Yum:

Edit /etc/yum/pluginconf.d/versionlock.list to remove the lock for yum packages locked with the versionlock plugin.

Apt:

Remove .pref files from /etc/apt/preferences.d/ that are responsible for pinning packages. Use the apt-mark unhold command on each of these packages for apt systems.

3. After you have completed upgrading the puppet-agent package, ensure to restart the puppetserver service.

Upgrade PuppetDB

To get the newest functionalities available, we upgrade the PuppetDB.

second module of upgradation concept

Follow these steps to complete the upgradation.

1. There are two ways in which you can upgrade PuppetDB, that are, automatic upgradation or manual upgradation.

For automatic upgradation, add the value to the version parameter of puppetlabs/puppetdb module. This module exists in the puppetdb::globals class.

For manual upgradation, run the following command in the package installer of the PuppetDB node.

Yum:

yum update puppetdb

 

Apt:

apt-get update
apt-get install --only-upgrade puppetdb

 

2. Now, upgrade the puppetdb-termini package by running the following command in the package installer of your primary server.

Yum:

yum update puppetdb-termini

 

Apt:

apt-get update
apt-get install --only-upgrade puppetdb-termini 

Upgrade Puppet Agents

It is recommended to upgrade Puppet Agents regularly for the smooth functioning of the system.

third module of upgradation concept
  • Upgrade agents using the puppet_agent module

You can upgrade Puppet agents using the puppetlabs/puppet_agent module very easily. It supports upgrading Puppet agents on *nix, Windows, and macOS. To upgrade agents using the puppetlabs/puppet_agent module, install it first. Follow the steps below to proceed.

  1. Copy the puppet_agent class to agents you want to upgrade.
  2. Note open the forge of your site.pp file.
  3. In that file, mention the puppet_agent package and the parameters you want to upgrade to.

 

You can use the example site.pp file below for your reference.

# site.pp 
node default
{
  class
  {
      puppet_agent:
      package_version => '8.1.6',
      collection      => 'puppet8'
  }
}

 

This upgrades the Puppet Agent according to changes mentioned in the site.pp file.

Note that the above steps work only if the agent is managed by the Puppet Server. For those agents which are not managed by the Puppet Server, you need to declare the class in the puppet apply upgrade file.pp manifest. Use the example code below for the same.

# upgrade_file.pp
class
{ 
    puppet_agent:
    package_version => '7.0.0.224.gaf2034af',
    yum_source      => 'http://nightlies.puppet.com/yum',
    collection      => 'puppet7-nightly'
}

 

Once declared, now apply that manifest to complete the process.

 

  • Upgrade *nix agents

Using the puppetlabs/puppet_agent module when upgrading among the major versions of Puppet agents is always advisable. If you want to upgrade *nix agents without this module, use the system’s package manager. Run the respective codes on the agent node based on your system package installer.

1. For Yum (EL/Fedora)

yum update puppet-agent

 

2. For Zypper (SLES)

zypper up puppet-agent

 

3. For Apt (Debian/Ubuntu)

apt-get update
apt-get install --only-upgrade puppet-agent

 

Ensure that you have the accurate package installed before upgrading any agents to a major version. You can find these packages from the respective official websites of your system package installer.

 

  • Upgrade Windows agents

If you want to upgrade Windows agents without the puppetlabs/puppet_agent module, reinstall that agent using the installation instructions. There is no need to uninstall the previous agent before reinstalling unless you are upgrading from 32-bit to the 64-bit Puppet version.

 

  • Upgrade macOS agents

You can utilize the puppet resource command to upgrade macOS agents without the puppetlabs/puppet_agent module.

Frequently Asked Questions

Describe Puppet Reports.

Puppet creates a report every time it applies a catalog called Puppet Report. The catalog contains information about the run, events, resources, log messages, metrics, and metadata.

Mention a few features of Puppet.

A few features of Puppet include Idempotency, Cross-platform service, Open-source, and Managing Software Configurations.

Explain Puppet Production Environment.

A Puppet Production Environment is created by granting a specified configuration to a good number of agent nodes. Each node in the environment has its separate Puppet configuration and can be considered an individual Puppet Master server.

List the Operating Systems for which Puppet is available.

The puppet-specialist part is available for almost every operating system, including 30 stages and structures. However, the puppet-server part is available only for Linux Operating Systems.

Conclusion

On the whole, we understood the complete upgradation concept in Puppet. We discussed in detail three different components of the upgradation and key aspects related to it.

We hope the above discussion helped you understand Puppet's Upgradation Concept more clearly and can be used for future reference whenever needed. To learn more about Puppet and its components, you can refer to blogs on the Overview of Puppet ServerManaging Access in PuppetPuppet Query LanguageAccessing Console in Puppet, and Token-based Authentication in Puppet.

Visit our website to read more such blogs. Make sure you enroll in our courses, take mock tests, solve problems, and interview puzzles. Also, you can pay attention to interview stuff- interview experiences and an interview bundle for placement preparations. Do upvote our blog to help fellow ninjas grow.

Happy Coding!

Live masterclass