Skip to content

Latest commit

 

History

History
93 lines (56 loc) · 4.27 KB

README.md

File metadata and controls

93 lines (56 loc) · 4.27 KB

Let's build a tower (part 3)

Introduction

On previous chapter we configured Azure AD authentication and created hello-world project. Now we can try to do something more practical, for example, we could try to install NGINX package on a test environment.

Architecture

Scheme

The Ansible structure is agentless (it connects using SSH), and configurations are set up as playbooks written in YAML.

With the Tower we can manage playbooks and playbook directories by either placing them manually under the Project Base Path on the server, or by placing playbooks into a source code management (SCM) system supported by Tower, including Git, Subversion, Mercurial, and Red Hat Insights.

Prerequisites

Scheme

In our scenario we will use configuration, which contains following parts:

Also we need to configure NSG for a newly created VM - enable SSH access from AWX host IP address and open 80 port: NSG rules

Implementation

On AWX side we need to configure and run job template. To do that, please, complete following steps:

  1. Create an inventory
  2. Add a host to the inventory
  3. Create a credentials
  4. Setup a project
  5. Create a job template
  6. Launch the template

AWX Inventory

Inventory - a collection of hosts against which Jobs may be launched. Let's use understandable title: New Inventory

AWX Host

Now we can add Public IP address of our test VM to the hosts: New Host

AWX Credentials

Credentials in our case - are username and password values used to create test node: New Credentials

AWX Project

A Project is a logical collection of Ansible playbooks, represented in Tower. In this article we are using following Github repository: New Project

AWX Template

A job template is a definition and set of parameters for running an Ansible job. In the example below, we are applying "nginx-hello-world/main.yml" playbook to the "Azure Inventory" using "Azure Credentials" to access the test node: New Template

Results

After project configuration we can run it: Run Template

If template run job was successfull - we can try to access test node by HTTP: Check the results

Useful documentation

About Azure NSG

About Ansible playbooks

About AWX inventories

About AWX project

About AWX job templates

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)