diff --git a/tests/vars/redhat_clone_vars.yml b/tests/vars/redhat_clone_vars.yml new file mode 100644 index 0000000..198a787 --- /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 +__postgresql_rh_distros: + - AlmaLinux + - CentOS + - RedHat + - Rocky + +# Same as above but includes Fedora +__postgresql_rh_distros_fedora: "{{ __postgresql_rh_distros + ['Fedora'] }}" +# Use this in conditionals to check if distro is Red Hat or clone +__postgresql_is_rh_distro: "{{ ansible_distribution in __postgresql_rh_distros }}" +# Use this in conditionals to check if distro is Red Hat or clone, or Fedora +__postgresql_is_rh_distro_fedora: "{{ ansible_distribution in __postgresql_rh_distros_fedora }}" diff --git a/vars/AlmaLinux_10.yml b/vars/AlmaLinux_10.yml new file mode 120000 index 0000000..f830d5f --- /dev/null +++ b/vars/AlmaLinux_10.yml @@ -0,0 +1 @@ +RedHat_10.yml \ No newline at end of file diff --git a/vars/AlmaLinux_8.yml b/vars/AlmaLinux_8.yml new file mode 120000 index 0000000..ad7713d --- /dev/null +++ b/vars/AlmaLinux_8.yml @@ -0,0 +1 @@ +RedHat_8.yml \ No newline at end of file diff --git a/vars/AlmaLinux_9.yml b/vars/AlmaLinux_9.yml new file mode 120000 index 0000000..0eb3795 --- /dev/null +++ b/vars/AlmaLinux_9.yml @@ -0,0 +1 @@ +RedHat_9.yml \ No newline at end of file diff --git a/vars/CentOS_10.yml b/vars/CentOS_10.yml deleted file mode 100644 index 21580a3..0000000 --- a/vars/CentOS_10.yml +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: MIT ---- -__postgresql_packages: >- - {{ ['@postgresql:' + postgresql_version + - '/server'] if postgresql_version != '16' else - ['postgresql-server'] }} diff --git a/vars/CentOS_10.yml b/vars/CentOS_10.yml new file mode 120000 index 0000000..f830d5f --- /dev/null +++ b/vars/CentOS_10.yml @@ -0,0 +1 @@ +RedHat_10.yml \ No newline at end of file diff --git a/vars/CentOS_8.yml b/vars/CentOS_8.yml deleted file mode 100644 index 0f29bb1..0000000 --- a/vars/CentOS_8.yml +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-License-Identifier: MIT ---- -# Put internal variables here with CentOS 8 specific values. - -__postgresql_packages: ["@postgresql:{{ postgresql_version }}/server"] diff --git a/vars/CentOS_8.yml b/vars/CentOS_8.yml new file mode 120000 index 0000000..ad7713d --- /dev/null +++ b/vars/CentOS_8.yml @@ -0,0 +1 @@ +RedHat_8.yml \ No newline at end of file diff --git a/vars/CentOS_9.yml b/vars/CentOS_9.yml deleted file mode 100644 index 2b8de84..0000000 --- a/vars/CentOS_9.yml +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: MIT ---- -# Put internal variables here with CentOS 9 specific values. - -__postgresql_packages: >- - {{ ['@postgresql:' + postgresql_version + - '/server'] if postgresql_version != '13' else - ['postgresql-server'] }} diff --git a/vars/CentOS_9.yml b/vars/CentOS_9.yml new file mode 120000 index 0000000..0eb3795 --- /dev/null +++ b/vars/CentOS_9.yml @@ -0,0 +1 @@ +RedHat_9.yml \ No newline at end of file diff --git a/vars/Rocky_10.yml b/vars/Rocky_10.yml new file mode 120000 index 0000000..f830d5f --- /dev/null +++ b/vars/Rocky_10.yml @@ -0,0 +1 @@ +RedHat_10.yml \ No newline at end of file diff --git a/vars/Rocky_8.yml b/vars/Rocky_8.yml new file mode 120000 index 0000000..ad7713d --- /dev/null +++ b/vars/Rocky_8.yml @@ -0,0 +1 @@ +RedHat_8.yml \ No newline at end of file diff --git a/vars/Rocky_9.yml b/vars/Rocky_9.yml new file mode 120000 index 0000000..0eb3795 --- /dev/null +++ b/vars/Rocky_9.yml @@ -0,0 +1 @@ +RedHat_9.yml \ No newline at end of file diff --git a/vars/main.yml b/vars/main.yml index 2a6d0ec..211b1d1 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -33,3 +33,20 @@ __postgresql_no_subset_facts: [ansible_memory_mb] # the 'gather_subset' parameter of the 'setup' module __postgresql_required_facts_subsets: "{{ ['!all', '!min', 'hardware'] + __postgresql_required_facts | difference(__postgresql_no_subset_facts) }}" + +# BEGIN redhat distros variables +# Ansible distribution identifiers that the role treats like RHEL +__postgresql_rh_distros: + - AlmaLinux + - CentOS + - RedHat + - Rocky + +# Same as above but includes Fedora +__postgresql_rh_distros_fedora: "{{ __postgresql_rh_distros + ['Fedora'] }}" +# Use this in conditionals to check if distro is Red Hat or clone +__postgresql_is_rh_distro: "{{ ansible_distribution in __postgresql_rh_distros }}" + +# Use this in conditionals to check if distro is Red Hat or clone, or Fedora +__postgresql_is_rh_distro_fedora: "{{ ansible_distribution in __postgresql_rh_distros_fedora }}" +# END redhat distros variables