k3s-ansible
k3s-ansible copied to clipboard
Add CI to test the playbook
A CI to test that the playbook is running successfully would be nice.
- Should we use Github action, Travis, Circle CI or other ?
- We need to test that systemd services works so running the playbook in docker might not be suitable
I typically use GitHub Actions or Travis CI, so I'm most familiar with those.
For my Ansible playbook testing (which usually requires testing systemd services), I use Molecule and some Docker images that have systemd built-in; for example: https://github.com/geerlingguy/ansible-for-devops/tree/master/molecule
The one part that gets a little tricky is if we want to test a master and node, that would require two containers, and the networking can be a little tricky there.
Molecule seems the way to go indeed.
One finding from https://github.com/rancher/k3s-ansible/issues/40 is that not only does the OS of the target machines (that will run k3s) matter, but that the OS of the Ansible host matters, which is obvious in retrospect. So a full featured CI environment should include not only the set of OS that are supported as target devices, but also the set of OS that are supported as Ansible host devices.