Red Hat Training

A Red Hat training course is available for Red Hat Satellite

Chapter 4. Upgrading Puppet

Red Hat Satellite 6.4 only supports Puppet 5. The migration path for Puppet 5 supports only Puppet 4 to Puppet 5 migrations. Therefore, if you are using a version of Puppet prior to version 4, you must upgrade to Puppet 4 prior to upgrading to Satellite 6.4. Satellite 6.3 includes an upgrade path to Puppet 4, for more information, see the Upgrading Puppet section in the Satellite 6.3 Upgrading and Updating Red Hat Satellite guide.

During the Satellite upgrade process, Puppet is upgraded from Puppet 4 to Puppet 5. It is not a separate process. This chapter describes the process of preparing for the upgrade from Puppet 4 to Puppet 5.

Red Hat Satellite and Capsules do not have to be upgraded at the same time. You have the flexibility to upgrade Capsules depending on your progress with testing and upgrading Puppet modules. An alternative is to install new Capsules and move hosts to them after testing. You can use Satellite web UI, the Hammer CLI, or the bootstrap script to move hosts from a Puppet 4 Capsule to a Puppet 5 Capsule.

Cloning an existing Capsule to use for final testing of upgraded Puppet modules is also recommended. Cloning an existing Capsule can take a long time depending on the size of the repositories.

4.1. Configuring Puppet Host Parameters

By default, Satellite 6.4 sets the global parameter enable-puppet5. Provisioning templates, such as Kickstart files, use enable-puppet5 to provision new hosts to use the Puppet 5 agent if available. However, if the Puppet 4 agent is in a Content View attached to a host, this will be used in place of Puppet 5. If you want hosts to use Puppet 5, you must update Content Views associated with the hosts to contain the Puppet 5 agent.

Removing Puppet 4 Host Parameter

If you set the parameter enable-puppet4 in Satellite 6.3, it can now be safely removed.

  1. In the web UI, navigate to Configure > Host Groups and select the name of the host group you want to configure.
  2. Click the Parameters tab, and in the Host Group Parameters area, locate enable-puppet4.
  3. In the Actions column, click Remove.
  4. Click Submit to save the changes.

For CLI Users

Remove the enable-puppet4 parameter for all hosts in a hostgroup:

# hammer hostgroup delete-parameter \
--hostgroup my_hostgroup \
--name enable-puppet4

4.2. Testing Puppet Modules

Before upgrading to Satellite 6.4, you must first review your Puppet modules, and make changes, to ensure they are compatible with Puppet 5. For information on the changes in Puppet 5, see the Puppet 5.0 Release Notes on the Puppet website.

Use the Puppet 5.0 Release Notes on the Puppet website and the following guidelines to test your Puppet modules before you begin upgrading:

  • Test Puppet modules first on a workstation, separate from Satellite.
  • Check the command syntax using the puppet parser validate command.
  • Check for capital letters in the name of a class reference because this is no longer supported. Change class names to lower case; for example, change Class[MyClass] to Class[myclass].
  • If you have custom version comparison code in Ruby, note that the Range#intersection code to handle SemVer range matches has been removed.
  • If you have custom Ruby code that makes use of the deprecated string formatting methods in the TypeCalculator class, change your code to use the replacement TypeFormatter class because the string formatting methods in the TypeCalculator have been removed. For more information, see the Type mismatch describer should expand aliases issue on the Puppet website.
  • Previously, if a class was defined more than once their bodies were merged. A warning or error was displayed depending on the status of the --strict flag. Now, an error is always displayed except for the top scope class indicated by ‘’ (also known as ‘main’).

4.3. Upgrading Satellite Hosts to Puppet 5

Use this section to upgrade Satellite hosts to Puppet 5. Satellite Server and Capsule Server are upgraded to Puppet 5 as part of their respective upgrade procedures.

Prerequisites

Procedure

To upgrade a host to Puppet 5, complete the following steps:

  1. In the Satellite web UI, navigate to Hosts > Content Hosts and select the Content Hosts that you want to upgrade.
  2. From the Select Action list, select Manage Repository Sets.
  3. From the Repository Sets Management list, select the Red Hat Satellite 6.3 - Puppet 4 (for RHEL 7 Server) (RPMs) check box.
  4. From the Select Action list, select Override to Disabled.
  5. Click Yes to confirm the action.
  6. When the process completes, on the same set of hosts from the previous steps, from the Select Action list, select Manage Packages.
  7. Click Update All Packages.
  8. Click Yes to confirm the action.

For CLI Users

  1. On the host, search for the Puppet 4 RPM repository:

    # subscription-manager repos --list-enabled |grep puppet4
  2. Disable the Puppet 4 repository you find on the host, for example:

    # subscription-manager repos \
    --disable=rhel-7-server-satellite-tools-6.3-puppet4-rpms

    For more information about format of Puppet repositories, see Red Hat Satellite Tools - Puppet 4 in the Red Hat Satellite {PreviousVersion} Release Notes.

  3. Until BZ#1649764 is resolved, update the gofer package:

    # yum update gofer
  4. Restart goferd.

    # systemctl restart goferd
  5. Update all packages:

    # yum update