KB: Deploying AWX on Centos 7
Deploying AWX on Centos *7
Note below script(s) have been pulled together from various sites to ensure the smooth deployment of AWX on a centos OS. You may use the awxvertag variable value to select which release version you want to deploy. Note this is not a RPM deployment. Also, this works as of 03-2020, in case anything changes the script may require additional updates. For latest release version you may visit awx github repo: https://github.com/ansible/awx/releases
Install script.
#Enter the AWX Version here from github....
############################
awxvertag=9.2.0
############################
yum update -y
yum install -y ansible
ansible --version
#Required steps to setup AWX
###############################
#Install Enterprise Packages
yum install -y epel-release yum-utils
#Apply Firewall Settings
#NOTE: Firewalld service must be running at all times
firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --permanent --add-service=https
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
#Ansible Pre-Reqs
yum -y install git gcc gcc-c++ nodejs gettext device-mapper-persistent-data lvm2 bzip2 python3 python3-devel.x86_64 python python-devel python-pip
pip install --upgrade pip
#Install Python WinrRM
yum install krb5-workstation
pip install pywinrm
pip install pywinrm[ntlm]
pip-3 install pywinrm
pip-3 install pywinrm[ntlm]
pip-3 install pywinrm[credssp]
#pip-3 install pywinrm[kerberos]
#**************
#sudo ln -fs /usr/bin/python3.6 /usr/bin/python
#alias python="/usr/bin/python3.6"
########################
#Docker yum repo
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
#Install Docker CE
yum install -y docker-ce
#Enable Docker
systemctl enable --now docker.service
#Install Docker Compose
pip-3 install docker-compose
pip install docker-compose
cd ~
git clone -b $awxvertag https://github.com/ansible/awx.git
cd ~/awx/installer
sed -i 's|admin_password=.*|admin_password=password|g' inventory
sslkey=$(openssl rand -base64 30)
echo "*******************************"
echo "Keep this Key SAFE: $sslkey"
echo "*******************************"
sed -i "s|secret_key=.*|secret_key=$sslkey|g" inventory
grep -v '^#' inventory | grep -v '^$'
ansible-playbook -i inventory install.yml
docker ps
#NOTE: After the script execution completes you have to give 5-min for the DB to be provisioned. You may monitor the progress by monitoring task container logs: docker logs -f awx_task
Note below script(s) have been pulled together from various sites to ensure the smooth deployment of AWX on a centos OS. You may use the awxvertag variable value to select which release version you want to deploy. Note this is not a RPM deployment. Also, this works as of 03-2020, in case anything changes the script may require additional updates. For latest release version you may visit awx github repo: https://github.com/ansible/awx/releases
Install script.
Create installawx.sh file in /tmp and paste the script below, chmod 0777 the sh file and execute the sh file.
-----------------
#!/bin/bash#Enter the AWX Version here from github....
############################
awxvertag=9.2.0
############################
yum update -y
yum install -y ansible
ansible --version
#Required steps to setup AWX
###############################
#Install Enterprise Packages
yum install -y epel-release yum-utils
#Apply Firewall Settings
#NOTE: Firewalld service must be running at all times
firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --permanent --add-service=https
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
#Ansible Pre-Reqs
yum -y install git gcc gcc-c++ nodejs gettext device-mapper-persistent-data lvm2 bzip2 python3 python3-devel.x86_64 python python-devel python-pip
pip install --upgrade pip
#Install Python WinrRM
yum install krb5-workstation
pip install pywinrm
pip install pywinrm[ntlm]
pip-3 install pywinrm
pip-3 install pywinrm[ntlm]
pip-3 install pywinrm[credssp]
#pip-3 install pywinrm[kerberos]
#**************
#sudo ln -fs /usr/bin/python3.6 /usr/bin/python
#alias python="/usr/bin/python3.6"
########################
#Docker yum repo
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
#Install Docker CE
yum install -y docker-ce
#Enable Docker
systemctl enable --now docker.service
#Install Docker Compose
pip-3 install docker-compose
pip install docker-compose
cd ~
git clone -b $awxvertag https://github.com/ansible/awx.git
cd ~/awx/installer
sed -i 's|admin_password=.*|admin_password=password|g' inventory
sslkey=$(openssl rand -base64 30)
echo "*******************************"
echo "Keep this Key SAFE: $sslkey"
echo "*******************************"
sed -i "s|secret_key=.*|secret_key=$sslkey|g" inventory
grep -v '^#' inventory | grep -v '^$'
#Backing up Inventory file with the secret and pwd#NOTE: this is required in case GIT repo ~/awx is restored/destroyed you'll need this inventory file to recover/maintain database stability during upgrades
mkdir ~/awx_backupcp -f ~/awx/installer/inventory ~/awx_backup/
docker ps
Warning:
- If possible keep the same awx repo folder structure and only update the 'VERSION' file to do any upgrades.
- however, if you end-up getting a new git repo you must use the inventory file from the backup located in the ~/awx_backup folder. The backup inventory contains the security key and the password to the original install, which required for the DB updates
- Any future upgrades should be done using the ansible-playbook command: ansible-playbook -i inventory install.yml
---------------
#NOTE: After the script execution completes you have to give 5-min for the DB to be provisioned. You may monitor the progress by monitoring task container logs: docker logs -f awx_task
Login Username: admin password: password

Comments
Post a Comment