Automation Stack Design Idea – How do we automate the automation SAFELY?

In this post, would like to share my idea of Enterprise Automation Stack – in perspective of tools. I will also explain little bit of the concept behind why I feel these tools or concepts are needed in every Automation builds.

In every Automation stack, we start our journey from the lowest level – worker, which we will design and create our scripts or playbook to perform a singlet set of tasks to achieve 1 desired outcome and the tool or technology adopted must be capable of interacting directly with the endpoint and then perform some tasks on the device or machine and visually provides feedback on the outcome.

But then as more playbooks or scripts are created, you’ll realize that though most of the tasks are automated but still requires human to run those automations, eye-balling on the output to ensure the task performs as it should and the output is as of intended. – too much work for me

Puppet, Chef, Ansible, Ansible Tower/AWX, Windows DSC are some of the worker tools which I know that are really powerful in terms of execution but very limited when logical or certain decision making is required – they are designed this way to simplify the lower tier tasks.

In my upcoming project, I am using AWX as my lower tier automation tool to perform all the heavy lifting in my automation stack.

My use case is Network OS upgrade, which will have 3 different main task to perform

  • Image download and upload to device and must perform the following safety checks
    • Pre checks of disk space size
    • Download image from vendor
    • Upload to device
    • Post check to ensure image is uploaded successfully
  • Upgrading the device
    • Pre checks to ensure device disk consist of the desired image
    • Execute upgrade
    • Ensure device is up after reboot
    • Perform post check to make sure device is at desired version
  • Post capture
    • Capture logs, config, other operational needed outputs
3 different AWX workflow
a set of task in a AWX workflow to achieve 1 outcome

See, with ansible dealing with the heavy lifting, you sure wont want it to also perform heavy decision makings and though ansible does have workflows but the nature of ansible is supposed to adopt the “KISS” approach.

This is where a second layer of automation is required – Automate the automation! Yay!

This second layer of automation which I called it the “Orchestrator”, will be the worker’s manager to decide and inform the worker what to run, where to run, when to run and how it should be ran.

  • What to run – which job it is supposed to do now?
  • Where to run – which devices should it be performing that job?
  • When to run – What time it should be running this job?
  • How to run – must it run a certain job first before running this job?

Tools like StackStorm, Node-RED, IFTTT are some of the event triggering or workload orchestrator tools which enables you to stick different use cases together to achieve 1 or more business use case.

For me, I’m using Node-RED an IFTTT IOT tool which have the capability to deal with such logics in the simplest manner! – if the tool is hard to use, throw it away 

snapshot of node-red flow stitching multiple workflows together

What happens is Node-Red periodically poll tickets from a Centralize API server, determine the ticket state and based on the ticket state, perform API calls to AWX to perform that particular task for that ticket and monitor the job that AWX is running. This allows me to control the state of the ticket from start to the end and monitoring what AWX is doing and the job status.

Now with all these tools perform actions and tasks at different level, I would need a way to monitor and visualize the whole progress! Node-red and AWX does provide have Web UI but it does not allow me to know what the state of the deployment is, what is each automation tool doing and what is the current automation state.

This is where a Visualization tool is needed, though tools like Grafana and Kibana have powerful visualization capabilities but they do not fit my requirement of the need for custom API, storage and custom UI development needs.

For my case, I’m using my company’s platform which gives me the flexibility to host an Angular Application, create custom API which connects back to a MongoDB. This 3 component forms a custom application as my Visualization layer

I can view all the ticket created at one glance

I will know at detail level, what is ansible or node-red doing and the state of the automation

With this design, it gives me the flexibility to basically do anything when it comes to automation

  1. Perform a set of low-level tasks to achieve a outcome can be done with AWX
  2. Stich multiple tasks together to achieve a business outcome with node-red working with AWX
  3. High level visualize what the system is doing, where it is right now, what is the next step, when is the next step and how its going to be performed

Along the way of setting this Automation stack up from Ground 0, I do learn a lot of new knowledge, explored so many design approach and tools and now seeing every level work together. – major brain orgasm!

Upcoming, I will show you how I build my Automation Stack and how I incorporate IAAC (Infrastructure as a code) to build it up and dispose or replicate it as I please

Leave a comment

Design a site like this with WordPress.com
Get started