Tolerable Ansible
Ansible Playbooks are very easy to read and their linear execution makes it simple to understand what will happen while a playbook is executing. Unfortunately, in some circumstances, the things you need to automate may not function in a linear fashion. For example, I was once asked to perform the following tasks with Ansible:
- Notify an external patching system to patch a Windows target
- Wait until the patching process was completed before moving on with the remaining playbooks tasks
While the request sounded simple, upon further investigation it would prove more challenging for the following reasons:
- The system patched the server asynchronously from the call. i.e. the call into the patching system would simply put the target node into a queue to be patched
- The patching process itself could last for several hours
- As part of the patching process the system would reboot no fewer than two times but with an unspecified maximum depending on the patches which need to be applied
- Due to the specific implementation of the patching system the only reliable way to tell if patching was completed was by interrogating a registry entry on the client
- If the patching took too long to complete additional Continue reading