In the IT automation, Ansible AWX stands as a powerful open-source platform that facilitates the management and orchestration of complex tasks with simplicity and efficiency. With its user-friendly interface and robust features, AWX simplifies the deployment and management of Ansible projects, offering enhanced control and visibility over automation workflows. This step-by-step guide is tailored to assist users in the installation of Ansible AWX on Debian 12, a popular Linux distribution renowned for its stability and reliability. By following the instructions provided herein, users will navigate through the installation process seamlessly, ensuring the successful deployment of AWX within their Debian environment.
let’s dive into the Ansible AWX installation on Debian 12. First, let’s begin by creating your VPSie Account if you haven’t already done so, and then proceed to install the Debian 12 server as per your requirements.
To initiate the installation, please SSH into your system. Our first step is to advise updating your system prior to installing any software. To accomplish this, kindly execute the following commands:
sudo apt-get update -y
Add Ansible Repository
The Debian 12 default repository doesn’t include the Ansible package. Therefore, you’ll need to add the Ansible repository to your server. Begin by installing all necessary dependencies with the command below:
apt-get install apt-transport-https ca-certificates software-properties-common unzip gnupg2 curl git -y
After installing all the necessary dependencies, proceed to modify the sources.list file by incorporating the Ansible repository:
nano /etc/apt/sources.list
Add the following line:
deb http://ppa.launchpad.net/ansible/ansible/ubuntu focal main
Save the file and then add the GPG key using the command provided below:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
Update the repository cache using the following command:
apt-get update -y
Install Ansible and Docker CE
To install Ansible, execute the following command:
apt-get install ansible -y
After installing Ansible, confirm its version by executing the following command:
ansible --version
Now, download and add the Docker GPG key with the following command:
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Add the Docker CE repository to APT by executing the command below:
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list
Please execute the command below to refresh the repository and install Docker CE:
apt-get update -y
apt-get install docker-ce -y
After installation, confirm Docker’s status by executing the command below:
systemctl status docker
Install Docker Compose with other necessary dependencies
Initially, acquire the Docker Compose binary from the Git repository by executing this command:
wget https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-linux-x86_64
Transfer the downloaded binary to the /usr/bin/ directory:
mv docker-compose-linux-x86_64 /usr/bin/docker-compose
Set the executable permission to the docker-compose binary:
chmod +x /usr/bin/docker-compose
Verify the Docker Compose version using the command below:
docker-compose version
Now, install Node.js and NPM with the following command:
apt-get install nodejs npm -y
npm install npm --global
Please use the following command to set up PIP and other dependencies:
apt-get install python3-pip git pwgen -y
Install the Python module for Docker Compose by executing the following command:
pip3 install docker-compose==2.27.0
Install Ansible AWX
Initially, fetch the Ansible AWX from the GitHub repository by executing the subsequent command:
wget https://github.com/ansible/awx/archive/refs/tags/17.1.0.zip
After the download finishes, use this command to unzip the file:
unzip 17.1.0.zip
Afterwards, navigate to the extracted directory and create a secret key using the command provided below:
cd awx-17.1.0/installer/
pwgen -N 1 -s 30
Next, make modifications to the inventory file by specifying your secret key, admin username, and password.
nano inventory
Change the following lines:
admin_user=admin
admin_password=password
secret_key=TjFaBrbF9MYTEHVmRZJEIY6AoK8PD5
Save and close the file then run the Ansible playbook to install the Ansible AWX:
ansible-playbook -i inventory install.yml
The playbook mentioned above will retrieve certain Docker images and set up an Ansible AWX container. To ensure the integrity of all Docker images, execute the following command:
docker images
To verify all running containers, run:
docker ps
Access Ansible AWX Web Interface
Please open your web browser and navigate to http://server_ip in the browser’s address bar.
Please input your admin username and password, then proceed by clicking on the Login button. Afterward, you will be directed to the Ansible AWX dashboard.
Setting up Ansible AWX on Debian 11 is a straightforward process that empowers users with a powerful automation tool for managing their infrastructure. With clear instructions and minimal dependencies, this guide facilitates the deployment of AWX, enabling efficient orchestration and automation of tasks within Debian environments.