icatproject-contrib / icat-ansible

0 stars 3 forks source link

Investigate running CI on CentOS #28

Open louise-davies opened 4 years ago

louise-davies commented 4 years ago

Currently, our CI just runs on Ubuntu via TravisCI. Most other CI services provide the exact same offering. Anvil provides CI on CentOS VMs, but currently doesn't provide admin access on VMs which ansible requires. Another alternative is to use Docker, as most CI providers have provisions to set up Docker containers, but this then requires more work setting up the Docker container.

MRichards99 commented 2 years ago

Sadly, I don't think this is feasible with GitHub Actions for the time being. Currently, Actions only supports Ubuntu out of the box. I have tried a couple of workarounds to get Centos working.

There is a specific action on the marketplace that can run Ansible using Centos 7. I tried this and it has no way of specifying a vault password file and therefore won't pick up the vault (nor have a password to access it).

You can also run a Ubuntu Actions runner using a centos Docker image. I tried doing this but kept facing errors at every stage. I think the Playbook would have to be modified to cope with a Centos docker image running on a Ubuntu machine (there seems to be some limitations such as https://github.com/geerlingguy/ansible-role-mysql/issues/264 which I was unable to solve).

This is a shame because having Centos 7 on CI would mean the playbook would be tested more thoroughly, but I'm wary about spending excessive time looking at this without specific approval. I'll keep the issue open as I haven't come to a solution.