An Ansible Adventure: Using the Python API to list unmanaged packages

I’ve been trying to get into the habit of managing an ansible playbook to keep track of any manual installations or config tweaks I do on my local machine. No matter how vigilant you are though, there will always be packages you install that slip through the cracks. It would be great for example if you could run an ansible playbook which runs all the relevant install tasks, and then provides you a list of these “unmanaged packages” that are not handled by the playbook:

Understanding Python Decorators

Python decorators seem to be one of those mysterious parts of python code that other people write, and you just use. Here, we’ll be building a simple, but useful decorator from scratch and adding new functionality step by step to try and gain a better understanding of how decorators work, and how they can be used. For reference, python wiki provides an excellent library of python decorator patterns, from which we will steal the Retry example.