Upgrade Oracle Linux Automation Manager
Introduction
Existing administrators of Oracle Linux Automation Manager are familiar with its all-in-one single-instance deployment.
Oracle Linux Automation Manager allows administrators to upgrade their existing deployments and later migrate the upgraded instance into a clustered deployment. When upgrading, the instance converts to a single-host deployment and configures itself as a hybrid node.
The following lab provides instructions for upgrading Oracle Linux Automation Manager.
Objectives
In this lab, you'll learn how to:
- Upgrade Oracle Linux Automation Manager
Prerequisites
A system with a previous release of Oracle Linux Automation Manager installed.
For details on installing Oracle Linux Automation Manager, see Installing Oracle Linux Automation Manager on Oracle Linux .
Verify the Existing Installation
Note: When using the free lab environment, see Oracle Linux Lab Basics for connection and other usage instructions.
Information: The free lab environment deploys a running Oracle Linux Automation Manager installation ready for the upgrade. The deployment takes approximately 15-20 minutes to finish after launch. Therefore, you might want to step away while this runs and promptly return to complete the lab.
Open a terminal and configure an SSH tunnel to the deployed Oracle Linux Automation Manager.
The Oracle Linux Automation Manager deploys in the free lab environment to the
control-node
VM host.ssh -L 8444:localhost:443 oracle@<hostname or ip address>
Open a web browser and enter the URL.
https://localhost:8444
Note: Approve the security warning based on the browser used. For Chrome, click the
Advanced
button and then theProceed to localhost (unsafe)
link.Login to Oracle Linux Automation Manager with the USERNAME
admin
and the PASSWORDadmin
created during the automated deployment.After login, the WebUI displays.
Run the Upgrade
Switch to the terminal connected to the
control-node
instance running the Oracle Linux Automation Manager instance.Stop the Oracle Linux Automation Manager service.
sudo systemctl stop ol-automation-manager
Create a backup of the secret key used by Oracle Linux Automation Manager for encrypting automation secrets in the database.
sudo cp /etc/tower/SECRET_KEY ~/SECRET_KEY.olamv1
Create a backup of the database.
This command dumps the contents of the database into a file containing all the necessary SQL commands and data to restore the database.
sudo su - postgres -c pg_dumpall > /tmp/olamv1_db_dump
Stop the database service.
sudo systemctl stop postgresql
Remove the existing database data files.
sudo rm -rf /var/lib/pgsql/data
This command removes the existing database data files. The database gets rebuilt later using the dump file.
Uninstall the current database package.
sudo dnf -y remove postgresql
Enable the module stream for the new database version.
Oracle Linux Automation Manager allows using PostgreSQL 12 and 13 when upgrading. This lab uses version 13.
sudo dnf -y module reset postgresql sudo dnf -y module enable postgresql:13
Update the Oracle Linux Automation Manager repository package.
sudo dnf -y update oraclelinux-automation-manager-release-el8
Note: This step will report that there is nothing to do in the free lab environment as the initial deployment already installed the latest repository package for Oracle Linux Automation Manager.
Disable the older repository.
sudo dnf config-manager --disable ol8_automation
Enable the current repository.
sudo dnf config-manager --enable ol8_automation2
Update the Oracle Linux Automation Manager package.
sudo dnf -y update ol-automation-manager
Note: The following expected messages display in the output during the upgrade.
Upgrading : ol-automation-manager-2.1.0-10.el8.x86_64 26/28 warning: /etc/tower/settings.py created as /etc/tower/settings.py.rpmnew Running scriptlet: ol-automation-manager-2.1.0-10.el8.x86_64 26/28 ValueError: File context for /var/run/tower(/.*)? already defined
Install the database server.
sudo dnf -y install postgresql-server
Initialize, start, and restore the database.
sudo postgresql-setup --initdb sudo systemctl start postgresql sudo su - postgres -c 'psql -d postgres -f /tmp/olamv1_db_dump'
Confirm the database is available.
sudo su - postgres -c 'psql -l | grep awx'
Example Output:
[oracle@control-node ~]$ sudo su - postgres -c 'psql -l | grep awx' awx | awx | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
The output displays the
awx
account created within the database after performing the restore using the dump file.Replace the default Oracle Linux Automation Manager global settings file.
After the Oracle Linux Automation Manager package upgrade, the new default configuration file creates with an extension of
.rpmnew
. This process allows system administrators to check configuration differences and migrate necessary changes manually.sudo mv /etc/tower/settings.py /etc/tower/settings.py.save sudo mv /etc/tower/settings.py.rpmnew /etc/tower/settings.py
View the differences between the new and old global settings files.
sudo diff /etc/tower/settings.py /etc/tower/settings.py.save
Note: Any custom settings previously added to the
settings.py
file should be set in the WebUI or moved to a file under/etc/tower/conf.d
.Create a custom settings file containing the required settings.
cat << EOF | sudo tee /etc/tower/conf.d/olamv2.py > /dev/null CLUSTER_HOST_ID = '$(hostname -i)' DEFAULT_EXECUTION_QUEUE_NAME = 'tower' DEFAULT_CONTROL_PLANE_QUEUE_NAME = 'tower' EOF
This command sets the
CLUSTER_HOST_ID
setting to the system's IP address and the default queue names to the older default name oftower
. Values entered into configuration files need to follow Python syntax format.Note: When upgrading Oracle Linux Automation Manager, the
CLUSTER_HOST_ID
value needs to match the value from the previous installation to avoid Jobs getting stuck in a pending status after the upgrade.Update the Receptor configuration file.
The Receptor mesh is an overlay network that creates peer-to-peer connections between controllers and executors to handle the distribution of work.
sudo sed -i "s/0.0.0.0/$(hostname -i)/" /etc/receptor/receptor.conf
Verify the Receptor configuration file.
sudo cat /etc/receptor/receptor.conf
id:
is the hostname or IP address of the Oracle Linux Automation Manager system.port:
is the TCP listening port for the Receptor mesh, which defaults to TCP port 27199.
Deploy Oracle Linux Automation Manager.
Open a shell as the
awx
user.sudo su -l awx -s /bin/bash
Migrate any existing containers to the latest podman version while keeping the unprivileged namespaces alive.
podman system migrate
Pull the Oracle Linux Automation Engine execution environment for Oracle Linux Automation Manager.
podman pull container-registry.oracle.com/oracle_linux_automation_manager/olam-ee:latest
Use the
awx-manage
utility to set up the Oracle Linux Automation Manager instance.awx-manage makemigrations --merge awx-manage migrate awx-manage register_default_execution_environments exit
Restore the backup of the secret key file.
sudo cp ~/SECRET_KEY.olamv1 /etc/tower/SECRET_KEY
Restart NGINX.
sudo systemctl restart nginx
Start Oracle Linux Automation Manager.
sudo systemctl start ol-automation-manager
Verify the Upgrade
(Optional) Open a new SSH tunnel to the Oracle Linux Automation Manager instance if the previous SSH tunnel was closed.
ssh -L 8444:localhost:443 oracle@<hostname or ip address>
The Oracle Linux Automation Manager runs in the free lab environment on the
control-node
VM host.Refresh the web browser window used to display the previous WebUI, or open a new web browser window and enter the URL.
https://localhost:8444
The port used in the URL needs to match that of the SSH tunnel local port.
Note: Approve the security warning based on the browser used. For Chrome, click the
Advanced
button and then theProceed to localhost (unsafe)
link.Login to Oracle Linux Automation Manager again with the USERNAME
admin
and the passwordadmin
.After login, the WebUI displays.
The upgrade is complete and ready to run jobs.
For More Information
Oracle Linux Automation Manager Documentation
Oracle Linux Automation Manager Training
Oracle Linux Training Station