ansible

Fix for Ansible hanging when used with Docker and TTY

For almost all my Ansible roles on Ansible Galaxy, I have a comprehensive suite of tests that run against all supported OSes on Travis CI, and the only way that's possible is using Docker containers (one container for each OS/test combination).

For the past year or so, I've been struggling with some of the test suites having strange issues when I use docker exec --tty (which passes through Ansible's pretty coloration) along with Ansible playbooks running inside Docker containers in Travis CI. It seems that certain services, when restarted on OSes running sysvinit (like Ubuntu 14.04 and CentOS 6), cause ansible-playbook to hang indefinitely, resulting in a build failure:

MidCamp 2017 Presentation - Drupal VM for Drupal 8 Development

MidCamp is one of my favorite Drupal events—it hits the sweet spot (at least for me) in terms of diversity, topics, and camp size. I was ecstatic when one of my session submissions was accepted, and just finished presenting Developing for Drupal 8 with Drupal VM.

Drupal VM presentation slide

You can see slides from the presentation here: Drupal VM for Drupal 8 Development, but without the full video there are a lot of gaps (especially on slides where there's just a giant emoji!). Luckily, Kevin Thull of Blue Drop Shop is hard at work recording all the sessions and posting them to YouTube. He's already processed the video from my session, and it's available below:

Soup to Nuts: Using Drupal VM to build local and prod

Update, January 2019: I would like to point out that using Drupal VM to build production servers is not officially supported, and though it may work pretty well, you are own your own if you do use it in that capacity. Please see Drop 'official-ish' support for using Drupal VM to run production servers for more details. What follows was mostly a tech demo for a MidCamp session, and has only been used by a small fraction of the Drupal VM userbase.

In preparing for my session Developing for Drupal 8 with Drupal VM at MidCamp later this month, I wanted to build out an example of a canonical "this is the way I'd do it" Drupal 8 site using nothing but Drupal VM and Composer. And I wanted to build both my local development environment and a production environment on DigitalOcean, all using the Ansible automation playbooks built into Drupal VM.

Ansible for DevOps is $0.99 for Black Friday/Cyber Monday 2016!

I decided to discount Ansible for DevOps on LeanPub to $0.99 for Black Friday and Cyber Monday. The book has already been purchased by over 8,000 people on Amazon, LeanPub, and the iBooks Store, and is the only book available that covers the latest version of Ansible—and is continuously updated!

I've written a lot about the process of self-publishing, in case you're interested. I'm hoping to keep updating Ansible for DevOps every quarter or so indefinitely, to make it the best resource now—and as long as possible—for learning infrastructure automation!

Using Ansible through Windows 10's Subsystem for Linux

Ever since I heard about the new 'Beta' Windows Subsystem for Linux, which basically installs an Ubuntu LTS release inside of Windows 10 (currently 14.04), I've been meaning to give it a spin, and see if it can be a worthy replacement for Cygwin, Git shell, Cmder, etc. And what I was most interested in was whether I could finally point people to a more stable and friendly way of using Ansible on a Windows workstation.

In the past, there was the option of running Ansible inside Cygwin (and this is still the best way to try getting Ansible working in an older Windows environment), but this always felt kludgy to me, and I hated having to recommend either that or forcing Windows users to do a full Linux VM installation just to run Ansible commands. I finally updated my PC laptop to the latest Windows 10 Anniversary Update, and installed the Windows Subsystem for Linux, and lo and behold, Ansible works!

How I test Ansible configuration on 7 different OSes with Docker

The following post is an excerpt from chapter 11 in my book Ansible for DevOps. The example used is an Ansible role that installs Java—since the role is supposed to work across CentOS 6 and 7, Fedora 24, Ubuntu 12.04, 14.04, and 16.04, and Debian 8, I use Docker to run an end-to-end functional test on each of those Linux distributions. See an example test run in Travis CI, and the Travis file that describes the build.

Note: I do the same thing currently (as of 2019), but now I'm using Molecule to tie everything together; see Testing your Ansible roles with Molecule.

Require a minimum Ansible version in your Playbook

It's helpful to be able to enforce a minimum required Ansible version in Ansible playbooks. Ansible Roles have long been able to specify a minimum Ansible version—but only for Ansible Galaxy and ansible-galaxy-related dependency management.

I've found more and more that users who installed Ansible further in the past (in the 1.7.x or 1.8.x era) are now using some of my newer projects that require Ansible 2.0 (there are so many nice new shiny things!), and they're running into errors like:

ERROR: [DEPRECATED]: include + with_items is a removed deprecated feature.  Please update your playbooks.
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

The problem, as it turns out, is that these users are running a version < 2.0, but it's not very obvious based on that error message!

Self-Publish, don't write for a Publisher

I'm not a writer. I'm a software developer who communicates well. Because I'm a developer and software architect, I spend time evaluating solutions to find the best one. There are often multiple good options, but I try to pick the best among them.

When I chose to write a book two years ago, I evaluated whether to self-publish or seek out a publisher. I spent a lot of time evaluating my options, and chose the self-publishing route.

Because I'm asked about this a lot, I decided to summarize my reasons in a blog post, both to posit why self-publishing is almost always the right option for a beginning author, and to challenge publishers to convince me I'm wrong.

AnsibleFest 2016 Review and Ansible Roles for Fun and Profit video online!

It's been a few weeks since AnsibleFest San Francisco, and Ansible just posted the video recordings of all the sessions from AnsibleFest SF 2016! I was honored to be able to speak about Ansible Roles at this year's west coast AnsibleFest, and I also arrived a little early so I could participate in the Ansible Contributor Conference on July 27.

Ansible Roles - Jeff Geerling presenting at AnsibleFest SF 2016
Picture from my session courtesy of The Appnel Group.

Speaking about Ansible Roles at AnsibleFest SF 2016

I'm excited to announce that I'll be speaking at AnsibleFest San Francisco 2016, on July 28th, giving a session titled Ansible Roles - for Fun and Profit!

Image from AnsibleFest London
Image from AnsibleFest London, earlier in the year.

AnsibleFest is the major bi-annual Ansible conference, full of case studies, sessions and announcements. I'm excited to finally be able to attend, as I've been an avid user of Ansible since 2013, even to the point of writing one of the most popular introductory books on Ansible, Ansible for DevOps.