Upgrade to Oracle Linux Automation Manager

1
0
Send lab feedback

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

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.

  1. 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>
  2. 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 the Proceed to localhost (unsafe) link.

  3. Login to Oracle Linux Automation Manager with the USERNAME admin and the PASSWORD admin created during the automated deployment.

    olam-login

  4. After login, the WebUI displays.

    olam-webui

Run the Upgrade

  1. Switch to the terminal connected to the control-node instance running the Oracle Linux Automation Manager instance.

  2. Stop the Oracle Linux Automation Manager service.

    sudo systemctl stop ol-automation-manager
  3. 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
  4. 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
  5. Stop the database service.

    sudo systemctl stop postgresql
  6. 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.

  7. Uninstall the current database package.

    sudo dnf -y remove postgresql
  8. 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
    
  9. 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.

  10. Disable the older repository.

    sudo dnf config-manager --disable ol8_automation
  11. Enable the current repository.

    sudo dnf config-manager --enable ol8_automation2
  12. 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
  13. Install the database server.

    sudo dnf -y install postgresql-server
  14. 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'
    
  15. 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.

  16. 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
    
  17. 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.

  18. 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 of tower. Values entered into configuration files need to follow Python syntax format.

  19. 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
  20. 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.
  21. Deploy Oracle Linux Automation Manager.

    1. Open a shell as the awx user.

      sudo su -l awx -s /bin/bash
    2. Migrate any existing containers to the latest podman version while keeping the unprivileged namespaces alive.

      podman system migrate
    3. 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
    4. 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
      
  22. Restore the backup of the secret key file.

    sudo cp ~/SECRET_KEY.olamv1 /etc/tower/SECRET_KEY
  23. Restart NGINX.

    sudo systemctl restart nginx
  24. Start Oracle Linux Automation Manager.

    sudo systemctl start ol-automation-manager

Verify the Upgrade

  1. (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.

  2. 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 the Proceed to localhost (unsafe) link.

  3. Login to Oracle Linux Automation Manager again with the USERNAME admin and the password admin.

    olam2-login

  4. After login, the WebUI displays.

    olam2-webui

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

SSR