azure

Azure-related repository

View the Project on GitHub groovy-sky/azure

Let’s build a tower (part 1)

Introduction

In this article we are going to learn how-to install and configure AWX. AWX - is an open-source version of Red Hat Ansible Tower, for managing Ansible in more manageable and easier way. The aim of this experiment - have some fun and learn something new about Ansible.

Prerequisites

Before delving into techical details let’s first review what is needed to reproduce it on your side. List is following:

Architecture

To reproduce the solution in your environment you will need two files - azuredeploy.json and script.sh.

“azuredeploy.json” file is for the initial Azure deployment which creates Virtual Machine with Ubuntu 16.04. Names for created resources are generated using unique string and resource related string: Azure Deployment Template

“script.sh” file contains command for “azuredeploy.json” deployment and post-deployment logic for installing AWX on the new created VM: script.sh

Implementation

  1. Download required files to your Linux environment: Prepare files

  2. Go to the portal, create new group and copy group name and subscription id. Sign in to Azure CLI and run “script.sh” specifying group name and subscription id: Running the script

  3. During script execution you will be asked for a password for the VM. Please provide password which meet password requirements - Password

  4. Go to deployment resource group after deployment will be finished, click on newly created virtual machine, copy it DNS Name and access AWX using admin/MjXYQ4Cegf1dCnXpo credentials: VM DNS name

  5. Change admin password to something more secure: Password change

Under the hood

If you wondering what actually “script.sh” does - please read description below.

Overview

At first we are deploying from a scracth Ubuntu VM. After that we are starting to configure it and prepare for AWX installation using ‘custom script extension’ feature. We install NGINX web server and get SSL sertificate using Certbot. The web server is used as reverse proxy for accessing AWX in secure manner. Of course we also install Ansible (as it is core part of this solution) and Docker (which is used for running AWX environment). AWX configuration is modified so as PostgreSQL container has used data disk for storing a data.

As a result we get Ubuntu VM on which AWX is runned as bunch of containers and is accessible thru NGINX: Docker

References

Let’s build a tower (part 1)

Let’s build a tower (part 2)

Let’s build a tower (part 3)

Let’s build a tower (part 4)