Skip to content

Instantly share code, notes, and snippets.

@davivcgarcia
Last active March 14, 2021 05:41
Show Gist options
  • Save davivcgarcia/86bb4746c430ec719235217daf8198d8 to your computer and use it in GitHub Desktop.
Save davivcgarcia/86bb4746c430ec719235217daf8198d8 to your computer and use it in GitHub Desktop.
Ansible AWX - Basic Install Example @ RHEL 7

Ansible AWX - Basic Install Example @ RHEL 7

  1. Enable proper repositories:
subscription-manager repos --disable="*" \
                           --enable=rhel-7-server-rpms \
                           --enable=rhel-7-server-extras-rpms
  1. Update the system and install prerequisites:
yum update -y
yum install docker docker-python git ansible vim bash-completion
reboot
  1. Configure and enable Docker Engine:
docker-storage-setup 
systemctl enable docker
systemctl start docker
  1. Clone the Ansible AWX Github repositories (use the latest release branch):
cd /root/
git clone https://github.com/ansible/awx.git
  1. At the awx/installer directory, edit inventory file with the content:
localhost ansible_connection=local ansible_python_interpreter="/usr/bin/env python"

[all:vars]

# Version of AWX container images
dockerhub_base=ansible
dockerhub_version=latest

# Common Docker parameters
postgres_data_dir=/var/lib/awx/pgdocker
host_port=80

# Docker Compose Variable
docker_compose_dir=/var/lib/awx

# Local PostgreSQL Variables
pg_username=awx
pg_password=awxpass
pg_database=awx
pg_port=5432

# Default AWX admin (superuser) account
default_admin_user=admin
default_admin_password='r3dh4t1!'

# AWX Secret key
secret_key='changemeplz'

# Proxy
#http_proxy=http://proxy:3128
#https_proxy=http://proxy:3128
#no_proxy=mycorp.org

# AWX project data folder.
project_data_dir=/var/lib/awx/projects
  1. Run the AWX installer playbook:
cd awx/installer/
ansible-playbook -i inventory install.yml
@Freebase394
Copy link

Freebase394 commented Apr 29, 2019

I get this error:
TASK [local_docker : Start the containers] **************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unable to load docker-compose. Try pip install docker-compose. Error: No module named compose"}
to retry, use: --limit @/root/awx/installer/install.retry

image

@sammybenjamin
Copy link

First ERROR encountered at step 6 after following first 5 steps correctly. Please advise.

image

@vishnu-prasads
Copy link

vishnu-prasads commented Feb 12, 2020

First ERROR encountered at step 6 after following first 5 steps correctly. Please advise.

image

use python3 instead of python2. changing the python version in /etc/alternatives will not work. You have to manually link python3 as the default version.
unlink /usr/bin/python
ln -s /usr/bin/python3 /usr/bin/python

@amitchauhan1502
Copy link

I am also getting similar error despite setting default python version to python3 using :
unlink /usr/bin/python
ln -s /usr/bin/python3 /usr/bin/python

############ Linux Console- RHEL 7 #################
[root@localhost installer]# ansible-playbook -i inventory install.yml
[WARNING]: While constructing a mapping from /root/awx/installer/roles/local_docker/tasks/compose.yml, line 49, column 7, found a
duplicate dict key (when). Using last defined value only.

ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to have been in '/root/awx/installer/roles/local_docker/tasks/compose.yml': line 39, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  • block:
    • name: Start the containers
      ^ here

The error appears to have been in '/root/awx/installer/roles/local_docker/tasks/compose.yml': line 39, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  • block:
    • name: Start the containers
      ^ here

exception type: <class 'ansible.errors.AnsibleParserError'>
exception: no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to have been in '/root/awx/installer/roles/local_docker/tasks/compose.yml': line 39, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  • block:
    • name: Start the containers
      ^ here

[root@localhost installer]#

###########################

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment