Skip to content

Commit

Permalink
Add ParadeDB pre-check
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks committed Sep 17, 2024
1 parent dff29f6 commit 4f81e7b
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions automation/roles/pre-checks/tasks/extensions.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,42 @@
# yamllint disable rule:line-length
---
# Extension Auto-Setup: shared_preload_libraries

# TimescaleDB pre-check (if 'enable_timescale' is 'true')
# pre-checks
- name: TimescaleDB | Checking PostgreSQL version
run_once: true
ansible.builtin.fail:
msg:
- "The current PostgreSQL version ({{ postgresql_version }}) is not supported by the TimescaleDB."
- "PostgreSQL version must be {{ timescale_minimal_pg_version }} or higher."
when: postgresql_version|string is version(timescale_minimal_pg_version|string, '<')
- "PostgreSQL version must be {{ timescale_minimal_pg_version | default(12) }} or higher."
when:
- (enable_timescale | default(false) | bool) or (enable_timescaledb | default(false) | bool)
- postgresql_version | string is version(timescale_minimal_pg_version | default(12) | string, '<')

# Extension Auto-Setup: shared_preload_libraries
- name: ParadeDB | Checking supported operating system and version
run_once: true
ansible.builtin.fail:
msg:
- "ParadeDB (pg_search, pg_analytics) is not supported on {{ ansible_distribution }} {{ ansible_distribution_release }}."
- "Supported OS: Debian (bookworm), Ubuntu (jammy, noble) or RedHat (8, 9)."
when:
- (enable_paradedb | default(false) | bool) or (enable_pg_search | default(false) | bool) or (enable_pg_analytics | default(false) | bool)
- not (
(ansible_os_family == "Debian" and ansible_distribution_release in ['bookworm', 'jammy', 'noble']) or
(ansible_os_family == "RedHat" and ansible_distribution_major_version in ['8', '9'])
)

- name: ParadeDB | Checking PostgreSQL version
run_once: true
ansible.builtin.fail:
msg:
- "The current PostgreSQL version ({{ postgresql_version }}) is not supported by the ParadeDB (pg_search, pg_analytics)."
- "PostgreSQL version must be {{ paradedb_minimal_pg_version | default(14) }} or higher."
when:
- (enable_paradedb | default(false) | bool) or (enable_pg_search | default(false) | bool) or (enable_pg_analytics | default(false) | bool)
- postgresql_version | string is version(paradedb_minimal_pg_version | default(14) | string, '<')

# shared_preload_libraries
- name: Create a list of extensions
run_once: true
ansible.builtin.set_fact:
Expand Down

0 comments on commit 4f81e7b

Please sign in to comment.