Note:
- This tutorial is available in an Oracle-provided free lab environment.
- It uses example values for Oracle Cloud Infrastructure credentials, tenancy, and compartments. When completing your lab, substitute these values with ones specific to your cloud environment.
Install Oracle Linux Automation Manager on Oracle Linux
Introduction
The following lab provides instructions for installing Oracle Linux Automation Manager on Oracle Linux.
Objectives
In this lab, you’ll learn how to:
- Enable the Oracle Linux DNF repository
- Set the firewall rules
- Download, install, and configure Oracle Linux Automation Manager
Prerequisites
- A system with Oracle Linux installed.
Enable the Oracle Linux DNF Repository and Set the Firewall Rules
Note: When using the free lab environment, see Oracle Linux Lab Basics for connection and other usage instructions.
Enable the required yum repositories and firewall rules before you install Oracle Linux Automation Manager.
-
Enable the latest Oracle Linux BaseOS repository.
sudo dnf config-manager --enable ol8_baseos_latest
-
Install the Oracle Linux Automation Manager repository.
sudo dnf -y install oraclelinux-automation-manager-release-el8
-
Enable the required repositories for installation.
sudo dnf config-manager --disable ol8_automation sudo dnf config-manager --enable ol8_automation2 ol8_addons ol8_UEKR7 ol8_appstream
-
Add the HTTP/HTTPS services to the firewall rules.
sudo firewall-cmd --add-service=https --permanent sudo firewall-cmd --reload
Install a Local Postgresql Database
-
Enable the module stream.
sudo dnf module reset postgresql sudo dnf -y module enable postgresql:13
-
Install the database.
sudo dnf -y install postgresql-server
-
Initialize the database.
sudo postgresql-setup --initdb
-
Switch the password storage mechanism to scram-sha-256.
sudo sed -i "s/#password_encryption.*/password_encryption = scram-sha-256/" /var/lib/pgsql/data/postgresql.conf
-
Enable and start the database.
sudo systemctl enable --now postgresql
-
Create the database user accounts.
Important: For this free lab environment, use a password of
password
at the prompt. This password is not secure and is only used for demonstraton purposes in this environment.sudo su - postgres -c "createuser -S -P awx"
-
Create the database.
sudo su - postgres -c "createdb -O awx awx"
-
Update host-based authentication file.
echo "host all all 0.0.0.0/0 scram-sha-256" | sudo tee -a /var/lib/pgsql/data/pg_hba.conf > /dev/null
-
Update the database listener IP address.
sudo sed -i "/^#port = 5432/i listen_addresses = '"$(hostname -i)"'" /var/lib/pgsql/data/postgresql.conf
-
Restart the database.
sudo systemctl restart postgresql
Install and Configure Oracle Linux Automation Manager
-
Install the Oracle Linux Automation Manager package and any dependencies.
sudo dnf -y install ol-automation-manager
-
Update the Redis configuration file.
sudo sed -i '/^# unixsocketperm/a unixsocket /var/run/redis/redis.sock\nunixsocketperm 775' /etc/redis.conf
-
Add the CLUSTER_HOST_ID to a custom settings file.
cat << EOF | sudo tee -a /etc/tower/conf.d/olam.py > /dev/null CLUSTER_HOST_ID = '$(hostname -i)' EOF
-
Fix permissions on the custom settings file.
sudo chown awx.awx /etc/tower/conf.d/olam.py sudo chmod 0640 /etc/tower/conf.d/olam.py
-
Add database settings to a custom configuration file.
cat << EOF | sudo tee /etc/tower/conf.d/db.py > /dev/null DATABASES = { 'default': { 'ATOMIC_REQUESTS': True, 'ENGINE': 'awx.main.db.profiled_pg', 'NAME': 'awx', 'USER': 'awx', 'PASSWORD': 'password', 'HOST': '$(hostname -i)', 'PORT': '5432', } } EOF
-
Fix permissions on the database custom configuration file.
sudo chown awx.awx /etc/tower/conf.d/db.py sudo chmod 0640 /etc/tower/conf.d/db.py
-
Pull the Oracle Linux Automation Manager container image.
sudo su -l awx -s /bin/bash podman system migrate podman pull container-registry.oracle.com/oracle_linux_automation_manager/olam-ee:latest
-
Create the Oracle Linux Automation Manager schema and admin user account.
awx-manage migrate awx-manage createsuperuser --username admin --email admin@example.com
Note: In the previous example,
admin@example.com
is an example email address of the admin user. -
Enter and confirm the password for the admin user.
-
Exit the awx user shell.
exit
-
Generate a SSL certificate for NGINX.
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ -keyout /etc/tower/tower.key -out /etc/tower/tower.crt
Enter the requested information or just hit the
ENTER
key. -
Replace the default NGINX configuration.
cat << EOF | sudo tee /etc/nginx/nginx.conf > /dev/null user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; } EOF
-
Update the Receptor configuration file.
cat << EOF | sudo tee /etc/receptor/receptor.conf > /dev/null --- - node: id: $(hostname -i) - log-level: debug - tcp-listener: port: 27199 - control-service: service: control filename: /var/run/receptor/receptor.sock - work-command: worktype: local command: /var/lib/ol-automation-manager/venv/awx/bin/ansible-runner params: worker allowruntimeparams: true verifysignature: false EOF
-
Provision an instance and register execution environments.
sudo su -l awx -s /bin/bash awx-manage provision_instance --hostname=$(hostname -i) --node_type=hybrid awx-manage register_default_execution_environments awx-manage register_queue --queuename=default --hostnames=$(hostname -i) awx-manage register_queue --queuename=controlplane --hostnames=$(hostname -i) awx-manage create_preload_data exit
-
Start the service.
sudo systemctl enable --now ol-automation-manager.service
-
Disconnect from the server.
exit
Verify the Install
-
Using the same terminal window, configure an SSH tunnel.
ssh -L 8444:localhost:443 opc@<hostname or ip address>
Note: In the previous example,
<hostname or ip address>
is the hostname or IP address of the system running Oracle Linux Automation Manager . If hostname is used, the host must be resolvable. -
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 password created during setup.
For More Information
Oracle Linux Automation Manager Documentation
Oracle Linux Automation Manager Training
Oracle Linux Training Station
More Learning Resources
Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.
For product documentation, visit Oracle Help Center.
Install Oracle Linux Automation Manager on Oracle Linux
F47670-06
April 2023
Copyright © 2021, Oracle and/or its affiliates.