AWX. AlmaLinux 8. AWX installation with Docker containers
Links
https://github.com/ansible/awx/blob/devel/tools/docker-compose/README.md
Install
Utils install
dnf install -y epel-release
dnf install -y gcc make ansible python3-pip
pip3 install --upgrade pip
pip3 install wheel
pip3 install make
pip3 install setuptools_rust
pip3 install docker-compose
Docker install
dnf -y config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf -y remove podman buildah
dnf -y install docker-ce docker-ce-cli containerd.io
systemctl start docker.service
systemctl enable docker.service
docker version
Clone the repo
If you have not already done so, you will need to clone, or create a local copy, of the AWX repo. We generally recommend that you view the releases page: https://github.com/ansible/awx/releases/latest
Clone the latest stable tag (21.10.1 for example)
cd /opt/
git clone -b 21.10.1 https://github.com/ansible/awx.git
In the inventory file, set your pg_password, broadcast_websocket_secret, secret_key, and any other settings you need for your deployment.
cd /opt/awx/
nano ./tools/docker-compose/inventory
localhost ansible_connection=local ansible_python_interpreter="/usr/bin/env python3"
[all:vars]
# AWX-Managed Database Settings
# If left blank, these will be generated upon install.
# Values are written out to tools/docker-compose/_sources/secrets/
pg_password="dispersia85D"
broadcast_websocket_secret="dispersia85D"
secret_key="dispersia85D"
# External Database Settings
# pg_host=""
# pg_password=""
# pg_username=""
# pg_hostname=""
# awx_image="ghcr.io/ansible/awx_devel"
# migrate_local_docker=false
Build the Image
make docker-compose-build
Once the build completes, you will have a ansible/awx_devel image in your local image cache. Use the docker images command to view it, as follows:
docker images
... REPOSITORY TAG IMAGE ID CREATED SIZE ansible/awx_devel latest ba9ec3e8df74 26 minutes ago 1.42GB ...
Run AWX
Run the awx, postgres and redis containers. This utilizes the image built in the previous step, and will automatically start all required services and dependent containers. Once the containers launch, your session will be attached to the awx container.
For running docker-compose detached mode, start the containers using the following command: make docker-compose COMPOSE_UP_OPTS=-d
Running the above command will create a cluster of 1 control node, 1 hop node, and 2 execution nodes. The number of nodes can be changed: CONTROL_PLANE_NODE_COUNT=2 EXECUTION_NODE_COUNT=3 COMPOSE_TAG=devel make docker-compose
CONTROL_PLANE_NODE_COUNT=1 EXECUTION_NODE_COUNT=1 COMPOSE_TAG=devel make docker-compose COMPOSE_UP_OPTS=-d
Wait for migrations to complete
Check if containers are installed and up
docker ps -a
Clean and build the UI
docker exec tools_awx_1 make clean-ui ui-devel
Create user "root"
docker exec -ti tools_awx_1 awx-manage createsuperuser
user: root password: PassWord
Enter web-interface
https://localhost:8043
user: root password: PassWord