![]() When I debugged this it became clear that, in these cases, Subiquity was installing and configuring the OpenSSH server quite early on in the installation. The main issue I came across was that Packer was having what appeared to be SSH authentication issues when building Subiquity configured images. Many of the packer files seemed to be having a hard time getting things working with the new installer, Subiquity. ![]() The more I looked at the issues the more I realised they mostly seemed to stem from the fact that Ubuntu changed their automated installer when the released the 20.04 Server image. I found a handful of apparently suitable Packer templates on the interwebs, but they all seemed to suffer from some problem or another and wouldn’t build cleanly. For this task I thought I would use Packer. ![]() I had a quick look at some of the public Vagrant boxes but decided that I would rather provision my own box, so I could easily control its specification. It would need (or I would need to be able to provision on to it) a mechanism of SSHing in to the operating system, for Molecule to use to apply and test the role. Looking at the molecule-vagrant docs it become apparent that I would need a virtual machine image in the form of a Vagrant box. Virtualbox can, of course, run a virtual machine which should provide an adequate platform on which to test my Docker role. One of these drivers, molecule-vagrant, utilises Vagrant which in turn can manage Virtualbox. Unfortunately in this case the role I wanted to test was responsible for managing Docker containers, so there was no easy way to run the role itself within a Docker container without causing some sort of Docker-in-Docker inception!Ī bit more digging in to the Molecule docs confirmed that Molecule utilises various “drivers” to provision the underlying platform to which the role is applied before testing. Reading the Molecule docs this seems to be a fairly straight forward task for the majority of cases, essentially you spin up a Docker container, provision your role and run your tests. The plan was to use Ansible Molecule to apply the role and drive the tests. I recently decided to write some tests for one of my Ansible roles that I’ve been making a lot of use of.
0 Comments
Leave a Reply. |