Fix debian playbook running on non-debian system

This commit is contained in:
Sanat Sathaye 2023-12-04 01:43:57 +05:30
parent 0232df1562
commit 1178eed471
2 changed files with 7 additions and 1 deletions

View file

@ -69,7 +69,7 @@
that:
- ansible_distribution in ['AlmaLinux', 'CentOS', 'RedHat', 'Rocky']
- ansible_distribution_major_version | int >= 9
fail_msg: "This playbook requires Enterprise Linux 9 or greater"
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