Using configuration management systems to automate parts of the Leapp pre-upgrade and upgrade process on Red Hat Enterprise Linux
This article describes how to use configuration management systems with a client-server architecture, such as Puppet, Chef, or Salt, to automate parts of the Leapp pre-upgrade and upgrade process.
Red Hat recommends using automation to achieve the scale required to perform Leapp upgrades in environments with hundreds or thousands of RHEL hosts. For information about an end-to-end automation approach, see This content is not included.How to automate upgrades before RHEL 7 end of maintenance.
IMPORTANT:
Red Hat recommends the following support considerations for customers who are automating the pre-upgrade and upgrade process by using configuration management systems:
- If you use a configuration management system with a client-server architecture, such as Puppet, Salt, or Chef, disable the system before running the
leapp preupgradecommand. Do not enable the configuration management system until after the upgrade is complete to prevent issues during the upgrade. - If you use a configuration management system with agentless architecture, such as Ansible, do not execute the configuration and deployment file, such as an Ansible playbook, during the in-place upgrade as described in Performing the upgrade from RHEL 7 to RHEL 8 or Performing the upgrade from RHEL 8 to RHEL 9.
- If you run into problems while running in-place upgrade using configuration management systems, make sure to have a reproducer without using configuration management systems before opening a support case with Red Hat Support.
Automating Leapp pre-upgrade answers
During the pre-upgrade process, in certain configurations, the Leapp utility generates true/false questions to determine how to proceed with the upgrade. All questions are stored in the /var/log/leapp/answerfile file. If the customer answers a question once, they won't have to answer again. Note that Leapp inhibits the upgrade if you do not provide answers to all the questions.
The first time the Leapp pre-upgrade is run on a system, a new answerfile file is generated. Any previous answerfile files are overwritten. As a result, you cannot use the answerfile file when automating parts of the pre-upgrade process.
The answerfile file answers are also stored in a answerfile.userchoices file generated by Leapp. The answerfile.userchoices file is not overwritten when the pre-upgrade is run for the first time on a system.
To automate parts of the Leapp pre-upgrade and upgrade process with configuration management tools, complete the following steps:
- Create and manage the answerfile.userchoices file. You can manually create this file before installing the Leapp utility.
- Remove the answerfile file before running the pre-conversion analysis or the upgrade to prevent possible issues caused by discrepancies between both files.
NOTE: If you update the answerfile.userchoices file directly, you must remove the answerfile file before running the pre-conversion analysis or the upgrade to prevent possible issues caused by discrepancies between both files.