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 Apr 29, 2020
1 parent d8fc0d3 commit be62b44
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ postgresql_ext_install_dev_headers: no
postgresql_ext_install_postgis: no

postgresql_ext_postgis_version: "2.5" # be careful: check whether the postgresql/postgis versions work together
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 @@ -806,6 +807,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
10 changes: 9 additions & 1 deletion tasks/install_yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@
name: ["ca-certificates","python-psycopg2", "python-pycurl", "glibc-common","epel-release","libselinux-python"]
state: present

- name: PostgreSQL | Add PostgreSQL Common repository | yum
yum_repository:
name: postgresql-common
description: postgresql yum repo
baseurl: "{{ postgresql_common_yum_repository_baseurl }}"
gpgkey: "{{ postgresql_yum_repository_gpgkey }}"
when: postgresql_install_repository

- name: PostgreSQL | Add PostgreSQL repository | yum
yum_repository:
name: postgresql
description: postgresql yum repo
baseurl: "{{ postgresql_yum_repository_baseurl }}"
gpgkey: "{{ postgresql_yum_repository_gpgkey }}"
when: postgresql_install_repository

- name: PostgreSQL | Make sure the dependencies are installed | yum
yum:
name: ["python-psycopg2", "python-pycurl", "glibc-common","libselinux-python"]
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 be62b44

Please sign in to comment.