Skip to content

Commit

Permalink
Fixing postgis.yml doesn't include yum / RedHat variation #258
Browse files Browse the repository at this point in the history
- Added common yum repo
- Updated postgresql_ext_postgis_deps for RedHat
  • Loading branch information
Justin Wrobel committed Nov 18, 2021
1 parent a3a7fed commit d1b56a6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ postgresql_postgis_release_compatibility:
13: "3.1"

postgresql_ext_postgis_version: "{{ postgresql_postgis_release_compatibility.get(postgresql_version) }}"
postgresql_ext_postgis_version_terse: "{{ postgresql_ext_postgis_version | replace('.','') }}"
postgresql_ext_postgis_version_terse: "{{ postgresql_ext_postgis_version | replace('.', '') }}" # Short version of the postgresql_ext_postgis_version, used in some path and filenames

postgresql_ext_postgis_deps:
- libgeos-c1
Expand Down Expand Up @@ -832,6 +832,7 @@ postgresql_yum_repository_url: "http://yum.postgresql.org"
postgresql_pgdg_repository_url: "https://download.postgresql.org/pub/repos/yum/"

# YUM (RedHat, CentOS, etc.) baseurl/gpgkey
postgresql_common_yum_repository_baseurl: "{{ postgresql_yum_repository_url }}/common/{{ ansible_os_family | lower }}/rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}"
postgresql_yum_repository_baseurl: "{{ postgresql_yum_repository_url }}/{{ postgresql_version }}/{{ ansible_os_family | lower }}/rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}"
postgresql_yum_repository_gpgkey: "{{ postgresql_pgdg_repository_url }}/RPM-GPG-KEY-PGDG-{{ postgresql_version_terse }}"

Expand Down
6 changes: 6 additions & 0 deletions tasks/install_rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
enabled: yes
when: postgresql_install_repository

- name: PostgreSQL | Make sure the dependencies are installed | yum
yum:
name: ["python-psycopg2", "python-pycurl", "glibc-common","libselinux-python"]
state: present
update_cache: yes

- name: PostgreSQL | Disable postgresql module (necessary for RHEL8+)
command:
cmd: dnf module disable postgresql -y
Expand Down
4 changes: 4 additions & 0 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
postgresql_cluster_name: "data"
postgresql_service_name: "postgresql-{{ postgresql_version }}"

postgresql_ext_postgis_deps:
- "postgis{{ postgresql_ext_postgis_version_terse }}_{{ postgresql_version }}"
- "postgis{{ postgresql_ext_postgis_version_terse }}_{{ postgresql_version }}-utils"

postgresql_varlib_directory_name: "pgsql"

# Used to execute initdb
Expand Down

0 comments on commit d1b56a6

Please sign in to comment.