Orchestration

Orchestration

As a dedicated, lazy system’s administrator you will learn to love shell scripts for doing work for you, instead of slaving at that command line repetitively typnig in the same command. You will even love creating a menagere of bits and pieces all over your network tied together with magical duct tape that probably only you have a clue about.

If you’re demented like me, you’ve got shell scripts launching shell scripts, launching network connections to launch shell scripts for all sorts of nefarious reasons. In desperate moments you may have actually written a full blown python or perl module to complete something that was insane trying to grok into sh

Better and better tools continue to roll out to help us dig ourselves out and the following are some of my Work in Progress (WIP) notes for using Ansible to ‘orchestrate’ organise my servers/services. It even helps me to distribute my menagere of scripts (do I really want to do that?)

From Simple Things

File Layout

As your Ansible playbooks expands in utility and usefulness, the following layout is what works for me (for now)

ansible\

  • com.example\
    • inventory
    • host_vars\
    • group_vars\
  • org.example\
    • inventory
    • host_vars\
    • group_vars\
  • roles\
    • playbook1.yml
    • playbook2.yml
    • playbook3.yml

roles is generally segmented in the following:

  • roles\
    • function1\
      • defaults\main.yml
      • files
      • templates
      • vars\main.yml
      • tasks\
        • main.yml
        • sub-task1.yml
        • sub-task2.yml