diff --git a/tests/vars/redhat_clone_vars.yml b/tests/vars/redhat_clone_vars.yml new file mode 100644 index 00000000..03b73028 --- /dev/null +++ b/tests/vars/redhat_clone_vars.yml @@ -0,0 +1,15 @@ +# vars for handling conditionals for RedHat and clones +--- +# Ansible distribution identifiers that the role treats like RHEL +__metrics_rh_distros: + - AlmaLinux + - CentOS + - RedHat + - Rocky + +# Same as above but includes Fedora +__metrics_rh_distros_fedora: "{{ __metrics_rh_distros + ['Fedora'] }}" +# Use this in conditionals to check if distro is Red Hat or clone +__metrics_is_rh_distro: "{{ ansible_distribution in __metrics_rh_distros }}" +# Use this in conditionals to check if distro is Red Hat or clone, or Fedora +__metrics_is_rh_distro_fedora: "{{ ansible_distribution in __metrics_rh_distros_fedora }}" diff --git a/vars/main.yml b/vars/main.yml index 0c739516..09ebc3c7 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -15,3 +15,20 @@ __metrics_required_facts: # the 'gather_subset' parameter of the 'setup' module __metrics_required_facts_subsets: "{{ ['!all', '!min'] + __metrics_required_facts }}" + +# BEGIN redhat distros variables +# Ansible distribution identifiers that the role treats like RHEL +__metrics_rh_distros: + - AlmaLinux + - CentOS + - RedHat + - Rocky + +# Same as above but includes Fedora +__metrics_rh_distros_fedora: "{{ __metrics_rh_distros + ['Fedora'] }}" +# Use this in conditionals to check if distro is Red Hat or clone +__metrics_is_rh_distro: "{{ ansible_distribution in __metrics_rh_distros }}" + +# Use this in conditionals to check if distro is Red Hat or clone, or Fedora +__metrics_is_rh_distro_fedora: "{{ ansible_distribution in __metrics_rh_distros_fedora }}" +# END redhat distros variables