From 27473b9865e8d716aa991cd33e9e186815933483 Mon Sep 17 00:00:00 2001
From: Imran Iqbal <iqbalmy@hotmail.com>
Date: Tue, 20 Jul 2021 18:01:34 +0100
Subject: [PATCH] test(pillar): use separate pillars to test `default` & `repo`
 suites

---
 test/salt/pillar/postgres.sls | 22 +++++-----------------
 test/salt/pillar/repo.sls     |  4 ++++
 2 files changed, 9 insertions(+), 17 deletions(-)
 create mode 100644 test/salt/pillar/repo.sls

diff --git a/test/salt/pillar/postgres.sls b/test/salt/pillar/postgres.sls
index 3bfa796..da4e734 100644
--- a/test/salt/pillar/postgres.sls
+++ b/test/salt/pillar/postgres.sls
@@ -8,21 +8,7 @@ postgres.port: '5433'
 {%- endif %}
 
 postgres:
-  # UPSTREAM REPO
-  # Set True to configure upstream postgresql.org repository for YUM/APT/ZYPP
-  {%- if grains.os_family != 'Debian' and salt['grains.get']('osfinger') != 'CentOS-6' %}
-  use_upstream_repo: False
-  {%- else %}
-  use_upstream_repo: True
-  # Version to install from upstream repository (if upstream_repo: True)
-  version: '13'
-  # # Set True to add a file in /etc/profile.d adding the bin dir in $PATH
-  # # as packages from upstream put them somewhere like /usr/pgsql-10/bin
-  # add_profile: False
-  # # If automatic package installation fails, use `fromrepo` to specify the
-  # # upstream repo to install packages from [#133, #185] (if upstream_repo: True)
-  # fromrepo: 'jessie-pgdg'
-  {%- endif %}
+  use_upstream_repo: false
 
   # ### MACOS
   # # Set to 'postgresapp' OR 'homebrew' for MacOS
@@ -177,7 +163,8 @@ postgres:
         public:
           owner: localUser
       # enable per-db extension
-      {%- if grains.os_family == 'Debian' and salt['grains.get']('osfinger') != 'Debian-8' %}
+      {#- TODO: Find a way to only disable this for the `default` suite, since it works with the `repo` suite #}
+      {%- if grains.os_family == 'Debian' and salt['grains.get']('osfinger') != 'Debian-9' %}
       extensions:
         uuid-ossp:
           schema: 'public'
@@ -190,7 +177,8 @@ postgres:
       owner: localUser
 
   # optional extensions to install in schema
-  {%- if grains.os_family == 'Debian' and salt['grains.get']('osfinger') != 'Debian-8' %}
+  {#- TODO: Find a way to only disable this for the `default` suite, since it works with the `repo` suite #}
+  {%- if grains.os_family == 'Debian' and salt['grains.get']('osfinger') != 'Debian-9' %}
   extensions:
     uuid-ossp:
       schema: uuid-ossp
diff --git a/test/salt/pillar/repo.sls b/test/salt/pillar/repo.sls
new file mode 100644
index 0000000..a4445e7
--- /dev/null
+++ b/test/salt/pillar/repo.sls
@@ -0,0 +1,4 @@
+---
+postgres:
+  use_upstream_repo: true
+  version: '13'
-- 
GitLab