Merge pull request #202 from sanatsathaye/main

Fix installation playbooks running on incompatible OSs
This commit is contained in:
Cody Robertson 2023-12-04 13:13:05 -05:00 committed by GitHub
commit d00ab06541
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View file

@ -65,11 +65,11 @@
lemmy_port: "{{ 32767 | random(start=1024) }}"
tasks:
- name: Ensure target system is >= EL9
ansible.builtin.fail:
msg: "This playbook requires Enterprise Linux 9 or greater"
when:
- ansible_distribution not in ['AlmaLinux', 'CentOS', 'RedHat', 'Rocky']
- ansible_distribution_major_version | int < 9
ansible.builtin.assert:
that:
- ansible_distribution in ['AlmaLinux', 'CentOS', 'RedHat', 'Rocky']
- ansible_distribution_major_version | int >= 9
fail_msg: "This playbook requires Enterprise Linux 9 or greater on the target server"
tags:
- always

View file

@ -69,6 +69,12 @@
name: nginx
state: reloaded
tasks:
- name: Ensure target system is Debian or Ubuntu
ansible.builtin.assert:
that:
- ansible_distribution in ['Debian', 'Ubuntu']
fail_msg: "This playbook requires Debian or Ubuntu on the target server"
- name: Install aptitude
ansible.builtin.apt:
name: aptitude