Deploy AWX using Ansible AWX LXC/LXD integration with this step-by-step guide. Our support team is always here to help you.

Deploy AWX Using Ansible AWX LXC/LXD Integration

ansible awx lxc/lxdIf you’re looking to deploy AWX using Ansible AWX LXC/LXD, you’re in the right place. This guide walks you through setting up AWX in an LXD container using Ansible, no fluff, just the exact steps and code you need. AWX is the open-source version of Red Hat Ansible Tower, and running it in LXD provides isolation, speed, and ease of management.

Let’s get straight to it.

Prerequisites

  • Before you begin, ensure the following:
  • Ansible 2.4+ is installed
  • LXD 2.0+ is installed on the host
  • You’re running on Ubuntu 16.04 LTS (although other distros may work)
  • Your LXD container has nesting enabled (see LXC mount AppArmor considerations)

Enable nesting on the container:

# lxc config set <lxc_name> security.nesting "true"

To allow remote management of the LXD host, run the following:

$ lxc config set core.https_address [::]:8443
$ lxc config set core.trust_password replace_this_with_a_secure_password

These steps are critical for successful ansible awx lxc/lxd deployment (source) and to avoid issues like LXC error: the network is currently in use.

Role Variables

Here’s a full breakdown of the role variables you can use:

# LXD Variables
awx_lxd_remote_server_name: []
awx_lxd_remote_server_url: []
awx_lxd_remote_server_port: "8443"
awx_lxd_remote_server_passwd: []
awx_lxd_config_dir: ".config/lxc/"
# AWX Variables
# Docker Image Versions
awx_dockerhub_base: ansible
awx_dockerhub_version: latest
awx_rabbitmq_version: 3.6.14
# Default Admin Credentials
awx_default_admin_user: admin
awx_default_admin_password: password
# AWX Secret Key (DO NOT CHANGE AFTER INITIAL SETUP)
awx_secret_key: awxsecret
# Common Docker Parameters
awx_postgres_data_dir: "/var/pgdocker"
awx_host_port: 80
awx_docker_images:
- "{{ dockerhub_base }}"/awx_task
- "{{ dockerhub_base }}"/awx_web
- postgres
- rabbitmq
- memcached
# Postgres Database Configuration
awx_pg_username: awx
awx_pg_password: awxpass
awx_pg_database: awx
awx_pg_port: 5432
# AWX Project Data Folder
awx_project_data_dir: /var/lib/awx/projects

Example Ansible Playbook

Use the following playbook to deploy awx lxc/lxd:

- hosts: all
become: truee
vars:
awx_lxd_remote_server_name: "mylxdserver"
awx_lxd_remote_server_url: "mylxdserver.example.org"
awx_lxd_remote_server_port: "8443"
awx_lxd_remote_server_passwd: "mypassword"
roles:
- ansible-awx-lxd

Why Use Ansible AWX LXC/LXD?

Deploying with ansible awx lxc/lxd brings you:

    • Lightweight and secure LXD containers
    • Automation via Ansible playbooks
    • Seamless Docker-based AWX deployment
    • Easy maintenance and upgrades
    • Ideal for development and small production use

[If needed, Our team is available 24/7 for additional assistance.]

Conclusion

Setting up this isn’t complicated if you follow each step precisely. With LXD containers, you get the flexibility of virtual machines with near bare-metal performance. Combine that with Ansible, and your infrastructure automation is ready to scale.

Use the above role and playbook exactly as shown, and you’ll have AWX running in LXD containers in no time. No unnecessary packages, no VM overhead, just pure containerized automation power.