Giter Club home page Giter Club logo

arts's Introduction

ARTS - Ansible Run Task Shim

Intro

This is a spike project to look at integration between HashiCorp Terraform Cloud / Enterprise and Ansible Automation Platform / AWX using the enterprise Terraform feature of 'Run Tasks'.

A Run Task is a way of integrating an enterprise Terraform platform with 3rd party applications and services.

In lieu of actual Run Task support in Ansible Automation Platform (AAP) / AWX, the goal is to create a simple shim that will act as an intermediary between the two platforms.

Usage

ARTs currently provides a mechanism to trigger the following actions in AAP/AWX:

  • Job Template Launching - Trigger AAP/AWX Job Templates. Note that the success criteria here is that we were able to succesfully trigger the JT, not that the JT itself completed successfully.

  • Workflow Job Template Launching - Trigger more compliex AAP/AWX Workflow Job Templates. As with Job Templates, note that the success criteria here is that we were able to succesfully trigger the Workflow JT, not that the Workflow JT itself completed successfully.

  • Inventory Creation - An Inventory will be created based on the Workspace Name. This wil become more useful if / when TFE/TFC support post-apply Run Tasks as we will be able to pre-populatre Ansible Inventories with IPs and Hostnames generated directly by a Terraform Apply, or hand crafted in Terraform Outputs.

Configuration

Build

This can either be built locally using the go compiler, or containerised for deployment elsewhere.

To deploy onto OKD/OpenShift Container Platform

$ oc new-project arts
$ oc new-build --binary --name=arts
$ ./build.sh
$ oc apply -f deployment/

ARTS

The only configuration required for ARTs is the resolvable FQDN name of the Ansible Automation Platform (AAP) / AWX Controller, and the initial credentials with which to authenticate against it.

These are supplied as the following Environment Variables:

ARTS_ANSIBLE_HOST - Controller FQDN
ARTS_ANSIBLE_USER - Controller Credential Username
ARTS_ANSIBLE_PASSWORD - Controller Credential Password

Terraform Cloud / Enterprise

ARTs needs to be configured as a Run Task within your Organisation Settings. The structure of the ARTs Run Tasks follows a very specific pattern:

https://{fqdn of arts}/public/{job/workflow/inventory}/{identifier}

where the identifier can be one of:

  • Job Template ID for the job endpoint e.g. https://my-arts-shim.onmi.cloud/public/job/1
  • Workflow Job Template ID for the workflow endpoint e.g. https://my-arts-shim.onmi.cloud/public/workflow/8
  • Organisation ID for the inventory endpoint e.g. https://my-arts-shim.onmi.cloud/public/inventory/1

This obviously means that to chain different AAP/AWX triggers, you must create different Run Tasks for each relevant Job Template, Workflow Job Template, or Inventory creation you wish to trigger.

The Details link from the Run Task in TFE/TFC will take you to the artifact in AAP/AWX. From there, if you have valid credentials for that platform, you'll be able to view the status of triggered process.

Authentication

On the subject of authentication, ARTs will generate an OAuth Token from AAP/AWX for each request based on the supplied credentials, and then revoke it irrespective of the outcome of that request.

It does not currently support the use of an HMAC Key to verify the authenticity of Run Task Requests from the enterprise Terraform Platform.

Screenshots

Run Task - Setup Screenshot

Run Task - Inventory Success Screenshot

Run Task - Inventory Failure Screenshot

Run Task - Job Template Success Screenshot

Run Task - Job Template Success Screenshot

arts's People

Contributors

benemon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.