Insights for Action

Some ansible woes

Grumpy Gorilla Anonymous from Pinterest

After some 12 years, I had to set up a new machine for my own use. I bought a reconditioned HP with around 16Gb RAM, 500Gb SSD. It came with a Windows OS, which I was going to wipe out. However, for various reasons (mainly some wonderful animation apps I use in teaching which require Mac or Windows only and need access to the sound system) I decided to keep the Windows host. First off, I decided to install my development machine under Vagrant/VirtualBox. I’m still fighting with VirtualBox (can’t get USB ext3 drives recognised, can’t get the sound working) and may end up having to dual boot. But apart from that, everything is wonderful. I suppose there’s a very minor inconvenience in having to logon to two computers (one real, one virtual) but that’s less hassle than dual booting.

It was possibly a little unfortunate that the new computer arrived close to Christmas. I therefore deluded myself into thinking I had plenty of time, so rather than just fire up my tried and tested dev box I thought I might upgrade the OS. I wasted a few hours trying to get Debian working - I could get a Debian server working but couldn’t get a KDE Desktop installed. As far as I can tell, this is related to Debian destroying the root account, but I decided I was just being a distro snob. So I reverted to Ubuntu. However (despite wasting a couple of hours wrangling Debian) I thought I should update my Ubuntu from 19.04 to 20.10. This is where the fun started.

Eventually, after a few hours of pure bafflement, I discovered that Vagrant insists on using ppa:ansible/ansible as its default-which-cannot-be-overridden repository. That was after spending quite a while trying to figure out why there were no ansible releases for Groovy Gorilla (at the time of writing, this is the current Ubuntu release 20.10). It turns out there are plenty of ansible releases for Groovy, in the Ubuntu repositories themselves. However, Vagrant forces you to use the ansible repositories and at time of writing they haven’t released anything newer than Eoan. A little bit of hunting around showed that you can install a python-only ansible using the pip installer. Unfortunately, that in turn caused a whole load of Python 2 stress. By default, amazingly, if you type python at a command line in Ubunutu Groovy you get Python 2. I couldn’t see a way of manipulating the playbook to reset the system Python to use Python 3. Eventually, I ended up with a very ugly hack. I provisioned using a shell script. The shell script installs ansible on the guest machine from the Ubuntu repositories and runs my playbook. This seems both hideously hacky and convoluted. My guess is that professionals use ansible from a server, and that using local provisioning system where you install ansible on the guest machine is rather a niche activity.

Anyway, I’ve written this blog to remind me what an annoying few hours it was, and hopefully next year I will find some slack time on a train. I can read around and see what I was doing that made it all so messy.

Share on: