diff --git a/defaults/main.yml b/defaults/main.yml index 1050a832..510e83a5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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" diff --git a/tasks/install.yml b/tasks/install.yml index ae750cf7..c5df1f47 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -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: diff --git a/tasks/install_yum.yml b/tasks/install_yum.yml index 33ec3003..5a6831d4 100644 --- a/tasks/install_yum.yml +++ b/tasks/install_yum.yml @@ -13,6 +13,7 @@ yum: name: "{{ postgresql_yum_repository_url }}" state: present + when: postgresql_install_repository - name: PostgreSQL | Install PostgreSQL yum: @@ -30,4 +31,3 @@ state: present environment: "{{ postgresql_env }}" when: postgresql_pgtune -