diff --git a/postgres/upstream.sls b/postgres/upstream.sls index 239f151f..83042be1 100644 --- a/postgres/upstream.sls +++ b/postgres/upstream.sls @@ -2,6 +2,7 @@ {%- from tpldir + "/macros.jinja" import format_kwargs with context -%} {%- if 'pkg_repo' in postgres -%} +{% set pg_common_version = salt['pkg.version']('postgresql-common') %} {%- if postgres.use_upstream_repo == true -%} @@ -24,6 +25,7 @@ postgresql-pkg-deps: # Add upstream repository for your distro {% if grains.os_family == 'Debian' %} + {% if salt['pkg.version_cmp'](pg_common_version, '246') <= 0 %} postgresql-repo-keyring: pkg.installed: - sources: @@ -31,6 +33,7 @@ postgresql-repo-keyring: - require_in: - pkgrepo: postgresql-repo {%- endif %} + {%- endif %} postgresql-repo: pkgrepo.managed: