Hi,
I´ve been assigned a task where I should be able to version our servers which are being provisioned by ansible. The ansible setup on the controller machine is located in a Git repo. I have ansible logging configured on the controller.
Now I was toying with the idea that it would be nice to perhaps push the last ansible command run and/or the git commit id to each server as I provision. This could obviously be done as a task but then I have to remember to include it or run the whole playbook each time.
I was hoping for a more elegant solution where maybe a callback plugin would be triggered on each execution which would retrieve the git commit id of the repo and then pushing it somehow to each server.
This way I could on any given server run a command which told me ansible commands executed against this server and/or associated git tags/hashes.
I´ve briefly looked at the http://docs.ansible.com/ansible/developing_plugins.html but it´s a lot of material to get though just to pick up and push a git commit to server atomatically.
Anyone have any good examples to start off with or comments if this is a good way to go about versioning?
Regards,
Henning