Whilst tidying up my mac-ansible repository in preparation for a talk I’m giving on it at the London Ansible Meetup tonight, I found my two-headed cow. It’s a bit of ASCII fan-art I made for the Fallout game series, whose post-apocalyptic setting has all the cows mutated this way.
(They’re pretty ugly creatures, so rather than post an image, here’s a link to the Fallout Wikia on them, for those curious enough to click.)
I made it to add a pinch of mutant fun to every Ansible run, which automatically uses
cowsay for output if it’s
installed. For example:
Ansible can be configured to use a different ‘cow’ with
cowsay comes with many by default, for example
(see previously). You can list all the options with
How to Get Yourself a Two-Headed Cow
cowsay is written in Perl, and if you check out
man cowsay you’ll find you can configure the cow graphic in a
cowfile with templated Perl code. Below is my two-headed cowfile. To use it, copy it
into a file called
two-heads.cow saved in the default
COWPATH directory, which you can also find from
For me, using
cowsay from homebrew on macOS, that path is
/usr/local/Cellar/cowsay/3.04/share/cows/. Yes, the path
includes the version, but don’t worry you won’t need to update it much - I haven’t seen a new version of
three years, it’s very stable software!
You can them immediately use it with cowsay:
Or with Ansible:
export that environment variable in your shell configuration file to
permanently use the cow of your choice.
The astute will have noted that the cowfile templates more than just the cow’s
“thoughts,” but also the eyes and tongue. This is so you can use various flags
that affect the cow’s state, for example
-d for dead:
Unfortunately Ansible has no way of passing these flags through.
For Special Occasions
I must admit though, the cows do sometimes get in the way, especially when
trying to paste Ansible output to others. I changed some time ago to normally
running Ansible with
ANSIBLE_NOCOWS=1 set, as per the FAQ about getting rid of the
I reserve my two-headed cow for special occasions. (And that is a sentence I never thought I’d write.)
© 2019 All rights reserved.