Listen To Your Servers Talk

March 21, 2014 by Michael DeHaan

While running your deployment process, it can be really useful to announce to your team what's going on.  You know what this is like -- somebody gets impatient and yells over the cube wall, "Hey Dennis!  Is that release getting pushed yet?".  Note: I've just freaked out somebody on the internet named Dennis.

Of course, that's not exactly automated - and isn't going to help Dennis when he gets that question over chat, email, and everything else.   Why not just let the system let people know what's up?  

Telling your team what's up helps them be more informed -- they'll know why they can't access the site right now, and also when they can.  If you're automating all the process of your deployments, why not automate these announcements as well?   Kick off a build, get some coffee, and Ansible can let you know how it's doing as things go.

Yep, Ansible has modules for that (TM).

Notification modules are resources that you can sprinkle throughout your playbooks to share information about what's going on with the rest of the world. 

The development branch (1.6) right now includes many of these (and many are already included in 1.5) -- including modules for Campfire, Flowdock, Grove, Hipchat, IRC, Jabber, Email (OMG!), Mqtt, Twilio, Nexmo, OSX's say command, Slack, and Typetalk.   You can read the documentation for each on the "notification module" index.  (We're also very open to pull requests for more additions).


Most of these talk to chat services, though Twilio and Nexmo are very cool SaaS options for sending SMS text messages from software, and there's also a message for this archaic system called "email".   This means that you can signal your favorite people for such events as "Hey, We're Pushing Out Release 3.14519 Now!", "Chevron 5 is Locked", and (most importantly) "Beer Time!", all automatically, as your playbook is running.

The osx_say module works by using OS X's text to speech in the audio domain, as humorously abused in my project Ansible & Juliet.  Yes, we went there.

How might it look in a playbook?  

Check out this GitHub Gist for an example using the IRC module.  

In addition to Notification modules, Callback plugins provide an even deeper and completely flexible level of integration.   Callbacks plugins allow for intercepting of any event in the Ansible API system, allowing for such actions as custom logging, emailing detailed reports, or also sending a complete play by play (rather than specific phrases) to a chat system.   Switch into this directory on GitHub to see how easy it can be.   To enable them, just copy the plugins over into your callbacks path, as configured in ansible.cfg.   The new Hipchat callback plugin is an excellent example of how to spam all details of your Ansible run out to your ops channel.

Automation doesn't have to be soulless. Whether you use notification plugins or callbacks, there are lots of ways to get Ansible to interact with you, the fleshy human servants of the computer world.

Related News

Deploying Highly Available OpenShift Origin Clusters | Installing and Building Docker With Ansible | Ansible Me A Sandwich | Fixing Heartbleed With Ansible | Orchestration, You Keep Using That Word | Windows Is Coming


Application Deployment, Continuous Integration, Configuration Management, IT Automation


Michael DeHaan

Ansible project founder.

rss-icon  RSS Feed

Ansible Tower by Red Hat
Ansible In-Depth Whitepaper
Ansible Tower by Red Hat
Learn About Ansible Tower