When working for a customer I was installing an Ansible Automation Platform cluster and to keep track of all systems I decided to create a nice message of the day, of course with cowsay.
Something like this:
___________________________ < Member of the AAP Cluster > | Host name : thunderbolt --------------------------- | Host alias : cn01 \ ^__^ | Function : Ansible AAP Control node \ (oo)\_______ | Location : Amsterdam (__)\ )\/\ | IP address : 192.168.63.194 ||----w | | VMware name : EXDTONKE01 || ||
After a couple of days, when everything was nicely up dan running, one of my co-workers logged in to these systems ans immediately said: I want that MOTD on all systems.
This turned out to be a bit easier said than done. I thought that I
could just install the cowsay
RPM during the playbook run and use the
cowsay
command from there on. But I didn’t want all hosts to have
cowsay
installed, as that would violate company policy. And installing
it in the executing container seemed to end in building a complete new
container-image with just cowsay
in there. I considered this to be way
to much of a hassle, so I went the extra mile.
I have created an Ansible Cowsay module!
In your playbook you can now use the Cowsay module, feed it a nice title and register a variable containing all the moo the cow said.
The code is on Github.
Happy mooo-ing.