From b043047af49f29ae9f162f6ffb147d4d517c3306 Mon Sep 17 00:00:00 2001 From: Toby Brain Date: Thu, 22 Sep 2016 11:22:24 +1000 Subject: [PATCH] Support only including postgres.client --- postgres/client.sls | 4 ++++ postgres/init.sls | 4 ++++ postgres/upstream.sls | 4 ---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/postgres/client.sls b/postgres/client.sls index f6dc928..95d06b8 100644 --- a/postgres/client.sls +++ b/postgres/client.sls @@ -9,6 +9,10 @@ install-postgresql-client: pkg.installed: - name: {{ postgres.pkg_client }} - refresh: {{ postgres.use_upstream_repo }} +{% if postgres.use_upstream_repo %} + - require: + - pkgrepo: install-postgresql-repo +{%- endif %} {% if postgres.pkg_libpq_dev %} install-postgres-libpq-dev: diff --git a/postgres/init.sls b/postgres/init.sls index 75f3caf..bce0647 100644 --- a/postgres/init.sls +++ b/postgres/init.sls @@ -16,6 +16,10 @@ postgresql-installed: pkg.installed: - name: {{ postgres.pkg }} - refresh: {{ postgres.use_upstream_repo }} +{% if postgres.use_upstream_repo %} + - require: + - pkgrepo: install-postgresql-repo +{%- endif %} # make sure the data directory and contents have been initialized postgresql-cluster-prepared: diff --git a/postgres/upstream.sls b/postgres/upstream.sls index 5ebb1fd..b17799b 100644 --- a/postgres/upstream.sls +++ b/postgres/upstream.sls @@ -9,8 +9,6 @@ install-postgresql-repo: - keyid: B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 - keyserver: keyserver.ubuntu.com - file: {{ postgres.pkg_repo_file }} - - require_in: - - pkg: postgresql-installed {%- elif grains['os_family'] == 'RedHat' -%} @@ -27,7 +25,5 @@ install-postgresql-repo: - gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG - require: - file: install-postgresql-repo - - require_in: - - pkg: postgresql-installed {%- endif %}