Friday, July 19, 2024

Setting Up Your Automation Playground: Ansible AWX on Ubuntu Desktop



Ansible AWX (formerly Ansible Tower) is a powerful web-based interface that simplifies and centralizes the management of your Ansible automation tasks. While primarily designed for production environments, AWX can be a valuable learning tool for individuals interested in exploring Ansible's capabilities. This article guides you through installing and configuring Ansible AWX on a Ubuntu desktop, providing a personal automation playground.

Important Note: While technically possible, running AWX on a desktop environment isn't officially supported by Red Hat. This guide is intended for educational purposes and should not be used in production environments.

Prerequisites:

  • Ubuntu Desktop (version 18.04 or later recommended)
  • Sudo privileges
  • Basic understanding of command line and Linux fundamentals

1. System Updates and Package Installation:

  • Ensure your system is up-to-date:
Bash
sudo apt update && sudo apt upgrade -y
  • Install required packages:
Bash
sudo apt install -y docker docker-compose python3-pip git

2. Docker Configuration (Optional):

While AWX can be deployed using virtual environments, Docker offers a more streamlined approach. If you haven't used Docker before, consider these steps:

  • Enable Docker service:
Bash
sudo systemctl enable docker
sudo systemctl start docker
  • Verify Docker functionality:
Bash
docker run hello-world

This should print a simple "Hello from Docker!" message.

3. Clone the AWX Installer Repository:

Bash
git clone https://github.com/ansible/awx-installer.git

4. Configure the AWX Inventory File:

Inside the awx-installer directory, navigate to the inventory folder and edit the inventory.localhost.yml file using a text editor like nano.

The key configuration points include:

  • docker_dir: Set this to a directory where Docker containers will store data (e.g., /opt/awx/data).
  • postgres_data_dir: Specify a directory for the PostgreSQL database used by AWX (e.g., /opt/awx/postgres).
  • rabbitmq_data_dir: Define a directory for the RabbitMQ data used by AWX (e.g., /opt/awx/rabbitmq).

Remember to adjust these paths based on your preferences.

5. Install and Configure AWX with Ansible:

Navigate back to the awx-installer directory and run the following command:

Bash
docker-compose run --rm awx-manage setup-env

This will download and install the necessary dependencies within Docker containers.

Once completed, run:

Bash
docker-compose up -d

This starts all AWX services in the background.

6. Initializing the AWX Web Interface:

  • Open a web browser and navigate to http://localhost:8080.
  • The AWX web interface should appear. Click "Get Started".
  • Choose "Install as a single server" and provide a strong admin password.
  • Click "Launch. This process initializes the AWX database and configures the web interface.

7. Accessing Your AWX Dashboard:

After a few minutes, the initialization should complete. You can now access the AWX web interface at http://localhost:8080 and log in with the admin credentials you set earlier.

Congratulations! You've successfully installed and configured Ansible AWX on your Ubuntu desktop.

8. Exploring AWX Features:

The AWX web interface offers a user-friendly platform for managing your Ansible playbooks, inventories, credentials, and projects. You can:

  • Create and upload Ansible playbooks.
  • Define inventories containing managed hosts.
  • Manage credentials for accessing target hosts.
  • Organize playbooks into projects for better manageability.
  • Schedule automated job executions based on your needs.

This allows you to explore the power of Ansible automation in a controlled and personalized environment.

Remember:

  • AWX on a desktop is intended for learning purposes.
  • For production environments, refer to the official AWX documentation for supported deployment methods.
  • Regularly update AWX and its dependencies to ensure security and performance.

This guide equips you with the knowledge to set up your own Ansible AWX playground on your Ubuntu desktop. Now, you can start exploring the exciting world of infrastructure automation and experiment with managing your local systems using Ansible playbooks. As you gain experience, consider exploring AWX deployment options for production environments to streamline your IT infrastructure management. 

No comments:

Post a Comment

Enhancing User Experience: Managing User Sessions with Amazon ElastiCache

In the competitive landscape of web applications, user experience can make or break an application’s success. Fast, reliable access to user ...