Introduction to AWX

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible, which is a powerful IT automation tool. It is the upstream project for Red Hat Ansible Tower, a commercial derivative of AWX. AWX allows users to manage Ansible playbooks, inventories, and Schedule jobs to run using the web interface.

Key Features of AWX:

  • Web Interface: AWX offers a user-friendly web interface that makes it easy to manage and run Ansible playbooks. It provides a dashboard with insights into your automation environment, including recent job activity and system status.
  • REST API: For those who prefer automation and integration with other services, AWX provides a REST API. This enables developers to programmatically manage their automation, integrate with other applications, or develop their own tools.
  • Task Engine: At its core, AWX uses Ansible’s task engine to handle automation jobs. This ensures that your automation is efficient, scalable, and reliable.
  • Scalability and Flexibility: AWX is designed to be scalable, allowing you to increase capacity as your automation needs grow. It also supports a wide range of environments and applications, providing the flexibility to tailor your automation.
  • Inventory Management: AWX simplifies the process of managing your inventory, making it easy to group and organize hosts. It supports dynamic inventories from cloud sources such as AWS, Google Cloud Platform, and more.
  • Role-Based Access Control (RBAC): AWX includes RBAC, allowing administrators to set permissions based on roles for users and teams. This ensures that only authorized individuals can access and execute certain tasks.
  • Scheduled Jobs: Automate your tasks by scheduling playbooks to run at specific times. This feature is perfect for routine automation, ensuring that your systems are updated, backed up, or checked for compliance regularly without manual intervention.

Installing AWX on a k3s Cluster

This guide outlines the steps to install AWX, the open-source version of Ansible Tower, on a Kubernetes cluster managed by k3s. k3s is a lightweight Kubernetes distribution that simplifies the deployment and management of containerized applications. By installing AWX on k3s, you can leverage the power of Ansible for automation in a scalable and resilient Kubernetes environment.

Prerequisites

Before you begin, ensure you have the following:

  • A running k3s cluster.
  • kubectl installed and configured to communicate with your k3s cluster.

Copy the aws repo

git clone [email protected]:ansible/awx-operator.git
cd awx-operator
  • Choose the tag to run
git checkout tags/2.11.0
  • create the kustomize file
make deploy
  • Deploy aws-operator
kubectl apply -k .
  • wait until you have the awx-operator running
kubectl get pods -n awx

Deploy your aws cluster

Create your service

  • Create the service
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
spec:
  service_type: LoadBalancer
  loadbalancer_protocol: http
  loadbalancer_port: 80
  • Create the ingressRoute
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: awx
  namespace: awx
  annotations: 
    kubernetes.io/ingress.class: traefik-external
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`www.awx.lab.welpnetwork.com`)
      kind: Rule
      services:
        - name: awx-service
          port: 80
    - match: Host(`awx.lab.welpnetwork.com`)
      kind: Rule
      services:
        - name: awx-service
          port: 80
      middlewares:
        - name: default-headers
  tls:
    secretName: lab-welpnetwork-com-tls
  • add the new file to the kustomize file
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  # Find the latest tag here: https://github.com/ansible/awx-operator/releases
  - github.com/ansible/awx-operator/config/default?ref=2.11.0
  - awx.yml
  - ingress.yml
  - default-headers.yml

# Set the image tags to match the git version from above
images:
  - name: quay.io/ansible/awx-operator
    newTag: 2.11.0

# Specify a custom namespace in which to install AWX
namespace: awx
  • apply the change
kubectl apply -k .
  • You can now retrieve the password in Rancher
  • Storage > Secrets > awx-admin-password
Password