LemmyNet / lemmy-ansible

A docker deploy for ansible
GNU Affero General Public License v3.0
248 stars 94 forks source link

Fix installation playbooks running on incompatible OSs #202

Closed sanatsathaye closed 7 months ago

sanatsathaye commented 7 months ago

The Almalinux playbook runs on Ubuntu and Debian, because the current fail logic is only succesful when both these conditions are true:

  1. Not RHEL
  2. Version < 9

So, it will only fail on some obscure system like Ubuntu 8 (side note, if you are trying to install Lemmy on a server with Ubuntu 8 I need answers).

To fix this I changed the fail to an assert and inverted the conditions. Changing the current "and" clause in the fail to an "or" would also make this work but IMO an assertion works better here.

codyro commented 7 months ago

What a fun catch! When I created the playbook, I tried to avoid it running on unsupported RHEL systems. I hadn't considered anyone would try the RHEL/Alma playbook on Ubuntu/Debian systems.

I'll get this checked and merged once I'm home :).

sanatsathaye commented 7 months ago

Yeah I did this by accident haha. It does eventually fail on one of the early RHEL exclusive steps (I think epel-release install?) so nothing major happens but let's not even allow this playbook to reach that stage shall we

sanatsathaye commented 7 months ago

Turns out the debian playbook also had the same issue so I added a check there as well. Haven't put a version check there though as there are still steps in the rest of the playbook for if version < 22.04. This can always be added later if the OS requirements change as Lemmy develops.

Also, I've clarified the fail_msg a bit in case people think it's for their system from where they're running ansible.

codyro commented 7 months ago

Thanks!

(Thanks @ticoombs for tagging this, I promise I'm trying to be mindful of it!)