Ansible & Ansible Tower (AWX) Lab Setup (PowerShell)

Magic scripts to setup Ansible & Ansible Tower (AWX) Learner’s Lab environment on a personal computer.

GOAL : Automate Setup of AWX learner’s lab setup.

Tool Stack

  • Git ( with SSH + Linux Utilities)
  • VirtualBox ( for spinning up virtual instances)
  • Vagrant ( for provisioning virtual instances using boxes )
  • Docker ( for running containers needed by AWX )

Approach

The series of steps involved in the script are illustrated in the below flow chart.

Get Started

To get started with the setup, download the below steps.

AnsibleMagicLab_Pre_Reboot.ps1

AnsibleMagicLab_Post_Reboot.ps1

Launch Sequence

Open Command Prompt in ‘Administrator’ mode.
Go to the scripts download location and execute the below command.

[1] Pre-Reboot Setup

powershell.exe -ExecutionPolicy Bypass -File AnsibleMagicLab_Pre_Reboot.ps1
On Successful installation of Vagrant, the machine should reboot.

Once the machine is up, Open Command Prompt in ‘Administrator’ mode, go to the scripts download location and execute the below command.

[1] Post-Reboot Setup

powershell.exe -ExecutionPolicy Bypass -File AnsibleMagicLab_Post_Reboot.ps1

Done that ?
Now you’ll be able to access your Ansible Tower (AWX) web interface using the Ip of the Vagrant machine.

Open up a browser and provide the IP <IP of AWX Instance> and hit Enter. You’ll get to see a page like below.

AWX Web Interface Login Screen

CREDENTIALS for AWX Login

username : admin
password : password

On successful login, you’ll see a dashboard similar to the below one.

AWX Web Interface Fresh Dashboard