Skip to content

Commit 2ba99be

Browse files
author
Jonathan Lozada D
authored
Merge pull request #343 from gclough/optional_flag_for_repo
Allow repo to be optional, in case of Satellite, Artifactory, etc.
2 parents 9ae74d4 + 60b3191 commit 2ba99be

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

defaults/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,12 +706,13 @@ postgresql_pgtune_type: "Mixed"
706706
postgresql_pgtune_connections: no
707707

708708

709-
710-
711709
postgresql_env:
712710
LC_ALL: "{{ postgresql_locale }}"
713711
LC_LCTYPE: "{{ postgresql_locale }}"
714712

713+
# Install repo, or rely on existing configuration (Satellite, Artifactory, etc.)
714+
postgresql_install_repository: true
715+
715716
# APT settings
716717
postgresql_apt_key_id: "ACCC4CF8"
717718
postgresql_apt_key_url: "https://www.postgresql.org/media/keys/ACCC4CF8.asc"

tasks/install.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
id: "{{ postgresql_apt_key_id }}"
1313
url: "{{ postgresql_apt_key_url }}"
1414
state: present
15-
when: postgresql_apt_key_url and postgresql_apt_key_id
15+
when: postgresql_apt_key_url and postgresql_apt_key_id and postgresql_install_repository
1616

1717
- name: PostgreSQL | Add PostgreSQL repository
1818
apt_repository:
1919
repo: "{{ postgresql_apt_repository }}"
2020
state: present
21-
when: postgresql_apt_repository | default('') != ''
21+
when: postgresql_apt_repository | default('') != '' and postgresql_install_repository
2222

2323
- name: PostgreSQL | Add PostgreSQL repository preferences
2424
template:
2525
src: etc_apt_preferences.d_apt_postgresql_org_pub_repos_apt.pref.j2
2626
dest: /etc/apt/preferences.d/apt_postgresql_org_pub_repos_apt.pref
27-
when: postgresql_apt_pin_priority
27+
when: postgresql_apt_pin_priority and postgresql_install_repository
2828

2929
- name: PostgreSQL | Make sure the dependencies are installed
3030
apt:

tasks/install_yum.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
yum:
1414
name: "{{ postgresql_yum_repository_url }}"
1515
state: present
16+
when: postgresql_install_repository
1617

1718
- name: PostgreSQL | Install PostgreSQL
1819
yum:
@@ -30,4 +31,3 @@
3031
state: present
3132
environment: "{{ postgresql_env }}"
3233
when: postgresql_pgtune
33-

0 commit comments

Comments
 (0)