Troubleshooting Ansible Automation Platform (AAP)

KF dogbe
6 min readOct 3, 2023

So happy, to have you here to help you install or troubleshooting Ansible Automation Platform. 😘 😍

Pre requisite

Host machine:

  • OS: Red Hat Entreprise Linux (RHEL 8.x.x / 9.x)
  • RAM: 5 Go (minimum requirement by Red Hat) stay till the end i will show you multiple ways to set with less than 5 Go (/!\ not recommanded in Production)

Need to have Red Hat developper account for free subscription.

Register RHEL operating system for free subscription (Only tree command need to pass)

Chapter 4. Registering the system and managing subscriptions Red Hat Enterprise Linux 8 | Red Hat Customer Portal

  • Connect to host machine as root and download latest Ansible Automation Platform tools

Red Hat Ansible Automation Platform Download | Red Hat Developer

❌ Make sure to download rigth version (check the size)

[root@localhost ~]#
[root@localhost ~]# cd /home/rhel/
[root@localhost rhel]# mkdir AAP
[root@localhost rhel]# cd AAP/
[root@localhost AAP]#
[root@localhost AAP]# ls -lrth
total 2,0G
-rw-r--r--. 1 root root 2,0G 2 oct. 20:43 ansible-automation-platform-setup-bundle-2.4-1-x86_64.tar.gz

Unarchive “ansible-automation-platform-setup-bundle-2.4–1-x86_64.tar.gz” file.

Go to to “ansible-automation-platform-setup-bundle-2.4–1-x86_64” folder and start update inventory file.

[root@localhost AAP]# tar xzf ansible-automation-platform-setup-bundle-2.4-1-x86_64.tar.gz
[root@localhost AAP]#
[root@localhost AAP]# ls -lrth
total 2,0G
drwxrwxrwx. 5 root root 107 26 juin 13:38 ansible-automation-platform-setup-bundle-2.4-1-x86_64
-rw-r--r--. 1 root root 2,0G 2 oct. 20:43 ansible-automation-platform-setup-bundle-2.4-1-x86_64.tar.gz
[root@localhost AAP]#
[root@localhost AAP]# cd ansible-automation-platform-setup-bundle-2.4-1-x86_64/
[root@localhost ansible-automation-platform-setup-bundle-2.4-1-x86_64]#

List content

[root@localhost ansible-automation-platform-setup-bundle-2.4-1-x86_64]#ls -lrth
total 32K
-rwxrwxrwx. 1 root root 15K 26 juin 13:38 setup.sh
-rw-rw-rw-. 1 root root 8,4K 26 juin 13:38 inventory
drwxrwxrwx. 2 root root 17 26 juin 13:38 group_vars
drwxrwxrwx. 3 root root 33 26 juin 13:38 collectionsb
drwxrwxrwx. 5 root root 55 26 juin 13:43 bundle
-rw-rw-rw-. 1 root root 530 26 juin 13:55 README.md

Update inventory file to be field like this:

..........................................
..........................................
[automationcontroller]
192.168.137.242 ansible_connection=local #192.168.137.242 <==private IP address

[automationcontroller:vars]
peers=execution_nodes
.........................................
.........................................
[all:vars]
admin_password='xxxxxx' #Update login admin password <=========

pg_host=''
pg_port=5432

pg_database='awx'
pg_username='awx'
pg_password='xxxxxx' # Update postgres admin password <==============
.........................
.......................
# ADD this line

[aap_valid_hosts] #Add this two line <===============
192.168.137.242

Run “setup.sh” file to deploy your Ansible Automation Platform

[root@localhost ansible-automation-platform-setup-bundle-2.4-1-x86_64]# ./setup.sh

Or

[root@localhost ansible-automation-platform-setup-bundle-2.4-1-x86_64]# bash setup.sh

😥Don’t worry, good part of troubleshooting are comming now.

ERROR 1: This machine does not have sufficient RAM to run Ansible Automation Platform

Output:

TASK [ansible.automation_platform_installer.preflight : fail] ******************
skipping: [192.168.135.242] => {"changed": false, "false_condition": "_locale.rc != 0", "skip_reason": "Conditional result was False"}

TASK [ansible.automation_platform_installer.postgres : include_tasks] **********
skipping: [192.168.135.242] => {"changed": false, "false_condition": "not postgres_exec_vars_only | bool", "skip_reason": "Conditional result was False"}

TASK [ansible.automation_platform_installer.postgres : include_tasks] **********
skipping: [192.168.135.242] => {"changed": false, "false_condition": "not postgres_exec_vars_only | bool", "skip_reason": "Conditional result was False"}

TASK [ansible.automation_platform_installer.postgres : include_tasks] **********
skipping: [192.168.135.242] => {"changed": false, "false_condition": "not postgres_exec_vars_only | bool", "skip_reason": "Conditional result was False"}

PLAY [Sanity check] ************************************************************

TASK [include_role : ansible.automation_platform_installer.preflight] **********

TASK [ansible.automation_platform_installer.preflight : Preflight check - Fail if this machine lacks sufficient RAM.] ***
fatal: [192.168.135.242]: FAILED! => {"changed": false, "msg": "This machine does not have sufficient RAM to run Ansible Automation Platform."}

NO MORE HOSTS LEFT *************************************************************

NO MORE HOSTS LEFT *************************************************************

PLAY RECAP *********************************************************************
192.168.135.242 : ok=23 changed=1 unreachable=0 failed=1 skipped=47 rescued=0 ignored=1
localhost : ok=0 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0

[error] Oops! An error occurred while running setup.
[warn] /var/log/tower does not exist. Setup log saved to setup.log.

Answer 1: Update yaml file

  • check default RAM requirement on “collections/ansible_collections/ansible/automation_platform_installer/roles/preflight/defaults/main.yml”
[root@localhost ansible-automation-platform-setup-bundle-2.4-1-x86_64]# cat collections/ansible_collections/ansible/automation_platform_installer/roles/preflight/defaults/main.yml
---
## Operational parameters

required_ram: 7400
ignore_preflight_errors: false

## Configurable parameters
[root@localhost ansible-automation-platform-setup-bundle-2.4-1-x86_64]#
  • Update default RAM required

Depend on your RAM size available set it accordingly.

/!\ On this labs i have 4.8 Go available 😟 why why, to be aline with requirement provide by redhat.

Red Hat Ansible Automation Platform Installation Guide Red Hat Ansible Automation Platform 2.0-ea | Red Hat Customer Portal

[root@localhost ansible-automation-platform-setup-bundle-2.4-1-x86_64]# free -h
total used free shared buff/cache available
Mem: 5,5Gi 721Mi 4,7Gi 24Mi 394Mi 4,8Gi
Swap: 2,3Gi 0B 2,3Gi “collections/ansible_collections/ansible/automation_platform_installer/roles/preflight/defaults/main.yml”

Edit file depend on your available free size: “collections/ansible_collections/ansible/automation_platform_installer/roles/preflight/defaults/main.yml”

[root@localhost ansible-automation-platform-setup-bundle-2.4-1-x86_64]# cat collections/ansible_collections/ansible/automation_platform_installer/roles/preflight/defaults/main.yml
---
## Operational parameters

required_ram: 4096 #Update with free available RAM <====
ignore_preflight_errors: false

## Configurable parameters
[root@localhost ansible-automation-platform-setup-bundle-2.4-1-x86_64]#

Answer 2: Pass extra var as additional variable before launch “setup.sh”.

Launch an installation setup file with ram requirement as parameter

[root@rhel ~]#./setup.sh -- -e required_ram=4096

Don’t hesitated to check help for more details

[root@rhel ~]# ./setup.sh --help
Usage: ./setup.sh [Options] [-- Ansible Options]

Options:
-i INVENTORY_FILE Path to ansible inventory file (default: ./inventory)
-e EXTRA_VARS Set additional ansible variables as key=value or YAML/JSON
i.e. -e bundle_install=false will force an online install

ERROR 2 : The system hostname cannot be localhost, receptor requires it to be set to something other than localhost

Output:

TASK [ansible.automation_platform_installer.preflight : Ensure hostname on nodes with receptor installed is not localhost] ***
fatal: [192.168.137.242]: FAILED! => {"changed": false, "msg": "The system hostname cannot be localhost, receptor requires it to be set to something other than localhost"}

NO MORE HOSTS LEFT *************************************************************

NO MORE HOSTS LEFT *************************************************************

PLAY RECAP *********************************************************************
192.168.137.242 : ok=30 changed=1 unreachable=0 failed=1 skipped=57 rescued=0 ignored=2
localhost : ok=0 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0

Answer: set hostname

[root@localhost ~]# hostname
localhost.localdomain
[root@localhost ~]# hostnamectl hostname rhel.my.example.com
[root@localhost ~]# hostname
rhel.my.example.com

I suggest you to update /etc/hosts files to be fit like this

[root@rhel ansible-automation-platform-setup-bundle-2.4-1-x86_64]# cat /etc/hosts
192.168.135.242 localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.135.242 rhel.my.example.com rhel

/!\ Need to restart your hosts or virtual machine to apply all modifictation

Make sure to enrolled rhel operation sytem to developer subscription

How to register and subscribe a RHEL system to the Red Hat Customer Portal using Red Hat Subscription-Manager? — Red Hat Customer Portal

Run “setup.sh” successfully

[root@localhost ansible-automation-platform-setup-bundle-2.4-1-x86_64]#./setup.sh

Output:

Connect to AAP GUI

https://192.168.135.242

Connexion with Username (admin) and password(set in inventory file)

Congratulation, we successfully get access to AAP 😍 🙌

Sorry, if details give here is in French, now you have to request free subscription from red hat developper account and every thing will be good to start.

Hopefully this will help your setup Ansible Automation Platform.

Many thanks for your time 😉 😘

Next: Ansible automation Hub: Galaxy NG (ansible.readthedocs.io)

--

--

KF dogbe

Cloud / Cybersecurity enthusiast. CehV10, RHCA, Comptia Sec +, ITF +, AWS Architect