18 lines
672 B
YAML
18 lines
672 B
YAML
---
|
|
- block:
|
|
- name: Add PostgreSQL repository
|
|
yum_repository:
|
|
name: postgresql
|
|
file: "{{ postgres_repository_filename }}"
|
|
description: PostgreSQL yum repository
|
|
baseurl: "https://download.postgresql.org/pub/repos/yum/{{ postgres_version }}/redhat/rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}"
|
|
gpgcheck: yes
|
|
enabled: yes
|
|
gpgkey: "https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-{{ postgres_version }}"
|
|
|
|
- set_fact:
|
|
postgres_packagename: "postgresql{{ postgres_version | regex_replace('\\.') }}-server"
|
|
become: True
|
|
become_user: root
|
|
when: postgres_repository_enabled
|