Skip to content

Commit

Permalink
Merge pull request #343 from gclough/optional_flag_for_repo
Browse files Browse the repository at this point in the history
Allow repo to be optional, in case of Satellite, Artifactory, etc.
  • Loading branch information
Jonathan Lozada D committed Apr 20, 2018
2 parents 9ae74d4 + 60b3191 commit 2ba99be
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -706,12 +706,13 @@ postgresql_pgtune_type: "Mixed"
postgresql_pgtune_connections: no




postgresql_env:
LC_ALL: "{{ postgresql_locale }}"
LC_LCTYPE: "{{ postgresql_locale }}"

# Install repo, or rely on existing configuration (Satellite, Artifactory, etc.)
postgresql_install_repository: true

# APT settings
postgresql_apt_key_id: "ACCC4CF8"
postgresql_apt_key_url: "https://www.postgresql.org/media/keys/ACCC4CF8.asc"
Expand Down
6 changes: 3 additions & 3 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
id: "{{ postgresql_apt_key_id }}"
url: "{{ postgresql_apt_key_url }}"
state: present
when: postgresql_apt_key_url and postgresql_apt_key_id
when: postgresql_apt_key_url and postgresql_apt_key_id and postgresql_install_repository

- name: PostgreSQL | Add PostgreSQL repository
apt_repository:
repo: "{{ postgresql_apt_repository }}"
state: present
when: postgresql_apt_repository | default('') != ''
when: postgresql_apt_repository | default('') != '' and postgresql_install_repository

- name: PostgreSQL | Add PostgreSQL repository preferences
template:
src: etc_apt_preferences.d_apt_postgresql_org_pub_repos_apt.pref.j2
dest: /etc/apt/preferences.d/apt_postgresql_org_pub_repos_apt.pref
when: postgresql_apt_pin_priority
when: postgresql_apt_pin_priority and postgresql_install_repository

- name: PostgreSQL | Make sure the dependencies are installed
apt:
Expand Down
2 changes: 1 addition & 1 deletion tasks/install_yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
yum:
name: "{{ postgresql_yum_repository_url }}"
state: present
when: postgresql_install_repository

- name: PostgreSQL | Install PostgreSQL
yum:
Expand All @@ -30,4 +31,3 @@
state: present
environment: "{{ postgresql_env }}"
when: postgresql_pgtune

0 comments on commit 2ba99be

Please sign in to comment.