2018-10-14 21:17:40 +00:00
|
|
|
---
|
|
|
|
- block:
|
|
|
|
- name: Add PostgreSQL repository
|
|
|
|
yum_repository:
|
|
|
|
name: postgresql
|
2018-10-14 21:39:55 +00:00
|
|
|
file: "{{ postgres_repository_filename }}"
|
2018-10-14 21:17:40 +00:00
|
|
|
description: PostgreSQL yum repository
|
2018-10-14 21:27:32 +00:00
|
|
|
baseurl: "https://download.postgresql.org/pub/repos/yum/{{ postgres_version }}/redhat/rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}"
|
2018-10-14 21:17:40 +00:00
|
|
|
gpgcheck: yes
|
|
|
|
enabled: yes
|
2018-10-14 21:27:32 +00:00
|
|
|
gpgkey: "https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-{{ postgres_version }}"
|
2018-10-14 21:17:40 +00:00
|
|
|
|
2018-10-14 21:49:19 +00:00
|
|
|
- set_fact:
|
2018-10-14 22:11:01 +00:00
|
|
|
postgres_packagename: "postgresql{{ postgres_version | regex_replace('\\.') }}"
|
|
|
|
|
|
|
|
- debug:
|
|
|
|
msg: "Set PostgreSQL package name to '{{ postgres_packagename }}'"
|
2018-10-14 21:17:40 +00:00
|
|
|
become: True
|
2018-10-14 21:28:12 +00:00
|
|
|
become_user: root
|
2018-10-14 21:49:19 +00:00
|
|
|
when: postgres_repository_enabled
|