56 lines
2.0 KiB
YAML
56 lines
2.0 KiB
YAML
---
|
|
- name: postgresql_org_repo | Debian or Ubuntu
|
|
when:
|
|
- pg_use_postgresql_org_repo
|
|
- ansible_distribution_file_variety == "Debian"
|
|
tags: ['postgresql', 'postgresql_repo', 'postgres_client']
|
|
block:
|
|
- name: postgresql_org_repo | Ensure that /etc/apt.d/keyrings exists
|
|
ansible.builtin.file:
|
|
dest: /etc/apt/keyrings
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: "0755"
|
|
- name: postgresql_org_repo | Get the signing key for the postgresql.org repository
|
|
ansible.builtin.get_url:
|
|
url: "{{ postgresql_deb_repo_key_url }}"
|
|
dest: "{{ postgresql_deb_repo_key }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
- name: postgresql_org_repo | Install the repository for Ubuntu
|
|
ansible.builtin.deb822_repository:
|
|
name: postgresql-org
|
|
types: [deb]
|
|
uris: "{{ postgresql_deb_repository_url }}"
|
|
components:
|
|
- main
|
|
suites: ["{{ postgresql_deb_repository_rel }}"]
|
|
signed_by: "{{ postgresql_deb_repo_key }}"
|
|
state: present
|
|
enabled: true
|
|
notify: Flush the APT cache
|
|
- name: postgresql_org_repo | Postgresql repo flush handlers
|
|
ansible.builtin.meta: flush_handlers
|
|
|
|
- name: postgresql_org_repo | Manage the EL repository
|
|
when:
|
|
- pg_use_postgresql_org_repo
|
|
- ansible_distribution_file_variety == "RedHat"
|
|
tags: ['postgresql', 'postgresql_repo', 'postgres_client']
|
|
block:
|
|
- name: postgresql_org_repo | Install the pgsql pgdg repository on EL 7
|
|
ansible.builtin.yum:
|
|
name: "{{ psql_el_pgdg_repo_url }}"
|
|
state: present
|
|
disable_gpg_check: true
|
|
when: ansible_distribution_major_version is version_compare('8', '<')
|
|
|
|
- name: postgresql_org_repo | Install the pgsql pgdg repository on EL 8+
|
|
ansible.builtin.dnf:
|
|
name: "{{ psql_el_pgdg_repo_url }}"
|
|
state: present
|
|
disable_gpg_check: true
|
|
when: ansible_distribution_major_version is version_compare('8', '>=')
|