Ansible Refactoring Series
Refactoring Ansible Modularity, Reuse, and Maintainability
In this series I want to explore refactoring a good, or at least decent, monolithic application deployment playbook into something more modular, easier to maintain, and with simpler and better reusability We’ll start by validating it works before our first pass at simply breaking it into more modular playbooks and separating out the variables.
Moving on we’ll identify what if any components would be be better off suited to roles and consider using one or more existing roles from Ansible Galaxy if appropriate. Finally we’ll turn our attention to the Postgresql component and look at how we could move this into an Ansible Collection, and if this makes sense.
-
More to come - July 23, 2020 Part 3: First Pass!
Sneak Preview
The Infrastructure
A simple multi-tier infrastructure with a load-balancer (HAProxy) acting as a front end to 2 app servers running a flask application using Postgres as its persistance datastore.
-
The Deployer Repo (github) - your job is to refactor this
The Application
-
The Application (github) - what is being deployed onto the app tier
Time to get started with Part 1: Setting up your Control Node