k3s-ansible icon indicating copy to clipboard operation
k3s-ansible copied to clipboard

Add CI to test the playbook

Open St0rmingBr4in opened this issue 5 years ago • 3 comments
trafficstars

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

St0rmingBr4in avatar May 12 '20 21:05 St0rmingBr4in

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.

geerlingguy avatar May 12 '20 21:05 geerlingguy

Molecule seems the way to go indeed.

St0rmingBr4in avatar May 12 '20 21:05 St0rmingBr4in

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.

fnord123 avatar Jun 06 '20 15:06 fnord123