diff --git a/tests/vars/rh_distros_vars.yml b/tests/vars/rh_distros_vars.yml new file mode 100644 index 0000000..d4a27a4 --- /dev/null +++ b/tests/vars/rh_distros_vars.yml @@ -0,0 +1,18 @@ +# vars for handling conditionals for RedHat and clones +# DO NOT EDIT - file is auto-generated +--- +# Ansible distribution identifiers that the role treats like RHEL +__selinux_rh_distros: + - AlmaLinux + - CentOS + - RedHat + - Rocky + +# Same as above but includes Fedora +__selinux_rh_distros_fedora: "{{ __selinux_rh_distros + ['Fedora'] }}" + +# Use this in conditionals to check if distro is Red Hat or clone +__selinux_is_rh_distro: "{{ ansible_distribution in __selinux_rh_distros }}" + +# Use this in conditionals to check if distro is Red Hat or clone, or Fedora +__selinux_is_rh_distro_fedora: "{{ ansible_distribution in __selinux_rh_distros_fedora }}" diff --git a/vars/main.yml b/vars/main.yml index 815295a..a7a2189 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -21,3 +21,21 @@ restorecon_threads: "{{ '-T 0' if ansible_distribution == 'Fedora' or ansible_distribution == 'SL-Micro' or (ansible_distribution_major_version | int > 8 and ansible_distribution in ['CentOS', 'RedHat', 'Rocky']) else '' }}" + +# BEGIN - DO NOT EDIT THIS BLOCK - rh distros variables +# Ansible distribution identifiers that the role treats like RHEL +__selinux_rh_distros: + - AlmaLinux + - CentOS + - RedHat + - Rocky + +# Same as above but includes Fedora +__selinux_rh_distros_fedora: "{{ __selinux_rh_distros + ['Fedora'] }}" + +# Use this in conditionals to check if distro is Red Hat or clone +__selinux_is_rh_distro: "{{ ansible_distribution in __selinux_rh_distros }}" + +# Use this in conditionals to check if distro is Red Hat or clone, or Fedora +__selinux_is_rh_distro_fedora: "{{ ansible_distribution in __selinux_rh_distros_fedora }}" +# END - DO NOT EDIT THIS BLOCK - rh distros variables