Ansible-role-postgresql: Postgres 9.6

Created on 14 Apr 2020  ·  5Comments  ·  Source: geerlingguy/ansible-role-postgresql

How could one adapt this role to install Postgres 9.6 on Centos7/RHEL7?

stale

Most helpful comment

Something like this should work:

- hosts: all
  tasks:
    - yum:
        name: "https://download.postgresql.org/pub/repos/yum/reporpms/EL-{{ ansible_distribution_major_version }}-x86_64/pgdg-redhat-repo-latest.noarch.rpm"
        state: present
      become: yes
    - import_role:
        name: geerlingguy.postgresql
      vars:
        postgresql_enablerepo: "pgdg96"
        postgresql_version: 9.6
        postgresql_packages:
          - postgresql96
          - postgresql96-server
          - postgresql96-contrib
          - postgresql96-libs
        postgresql_data_dir: /var/lib/pgsql/9.6/data
        postgresql_bin_path: /usr/pgsql-9.6/bin
        postgresql_config_path: /var/lib/pgsql/9.6/data
        postgresql_daemon: postgresql-9.6
      become: yes

All 5 comments

Something like this should work:

- hosts: all
  tasks:
    - yum:
        name: "https://download.postgresql.org/pub/repos/yum/reporpms/EL-{{ ansible_distribution_major_version }}-x86_64/pgdg-redhat-repo-latest.noarch.rpm"
        state: present
      become: yes
    - import_role:
        name: geerlingguy.postgresql
      vars:
        postgresql_enablerepo: "pgdg96"
        postgresql_version: 9.6
        postgresql_packages:
          - postgresql96
          - postgresql96-server
          - postgresql96-contrib
          - postgresql96-libs
        postgresql_data_dir: /var/lib/pgsql/9.6/data
        postgresql_bin_path: /usr/pgsql-9.6/bin
        postgresql_config_path: /var/lib/pgsql/9.6/data
        postgresql_daemon: postgresql-9.6
      become: yes

@kdhlab Beer on me ... Saved me some time :) This needs to be included in the example README.

Great example of var overrides required to run a different version than the defaults for CentOS 7. Worked for me.

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

Awesome! thanks for this input on this one! I agree, an example for this should be included in the README. :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

breml picture breml  ·  9Comments

FilBot3 picture FilBot3  ·  18Comments

svanschalkwyk picture svanschalkwyk  ·  6Comments

worldofchris picture worldofchris  ·  8Comments

GoodBoy962 picture GoodBoy962  ·  10Comments