diff --git a/.github/workflows/kitchen.vagrant.yml b/.github/workflows/kitchen.vagrant.yml index 3840668a4f338b55383c40c5b154e5d0b2550d69..9d34048801a4d868b48be14e44e99a7fbacdd4dd 100644 --- a/.github/workflows/kitchen.vagrant.yml +++ b/.github/workflows/kitchen.vagrant.yml @@ -15,8 +15,11 @@ jobs: matrix: instance: - default-freebsd-130-master-py3 + # - freebsd-130-master-py3 - default-freebsd-122-master-py3 + # - freebsd-122-master-py3 - default-freebsd-114-master-py3 + # - freebsd-114-master-py3 # - default-freebsd-130-3002-6-py3 # - default-freebsd-122-3002-6-py3 # - default-freebsd-114-3002-6-py3 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0d75c0e762900bf5dafa1e02da52bf23be0047fe..8f2c46277375a16fd31d33953a69a0b697f889aa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -102,7 +102,7 @@ rubocop: ############################################################################### # Define `test` template ############################################################################### -.test_instance: +.test_instance: &test_instance stage: *stage_test image: *image_dindruby services: *services_docker_dind @@ -117,6 +117,13 @@ rubocop: # Alternative value to consider: `${CI_JOB_NAME}` - 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"' +############################################################################### +# Define `test` template (`allow_failure: true`) +############################################################################### +.test_instance_failure_permitted: + <<: *test_instance + allow_failure: true + ############################################################################### # `test` stage: each instance below uses the `test` template above ############################################################################### @@ -135,26 +142,62 @@ rubocop: # default-oraclelinux-7-tiamat-py3: {extends: '.test_instance'} # default-almalinux-8-tiamat-py3: {extends: '.test_instance'} # default-rockylinux-8-tiamat-py3: {extends: '.test_instance'} -default-debian-11-master-py3: {extends: '.test_instance'} -default-debian-10-master-py3: {extends: '.test_instance'} -default-debian-9-master-py3: {extends: '.test_instance'} -default-ubuntu-2004-master-py3: {extends: '.test_instance'} -default-ubuntu-1804-master-py3: {extends: '.test_instance'} -default-centos-8-master-py3: {extends: '.test_instance'} -default-centos-7-master-py3: {extends: '.test_instance'} -default-fedora-34-master-py3: {extends: '.test_instance'} -default-fedora-33-master-py3: {extends: '.test_instance'} -default-opensuse-leap-153-master-py3: {extends: '.test_instance'} -default-opensuse-leap-152-master-py3: {extends: '.test_instance'} +# default-debian-11-master-py3: {extends: '.test_instance'} +# repo-debian-11-master-py3: {extends: '.test_instance'} +debian-11-master-py3: {extends: '.test_instance'} +# default-debian-10-master-py3: {extends: '.test_instance'} +# repo-debian-10-master-py3: {extends: '.test_instance'} +debian-10-master-py3: {extends: '.test_instance'} +# default-debian-9-master-py3: {extends: '.test_instance'} +# repo-debian-9-master-py3: {extends: '.test_instance'} +debian-9-master-py3: {extends: '.test_instance'} +# default-ubuntu-2004-master-py3: {extends: '.test_instance'} +# repo-ubuntu-2004-master-py3: {extends: '.test_instance'} +ubuntu-2004-master-py3: {extends: '.test_instance'} +# default-ubuntu-1804-master-py3: {extends: '.test_instance'} +# repo-ubuntu-1804-master-py3: {extends: '.test_instance'} +ubuntu-1804-master-py3: {extends: '.test_instance'} +# default-centos-8-master-py3: {extends: '.test_instance'} +# repo-centos-8-master-py3: {extends: '.test_instance'} +centos-8-master-py3: {extends: '.test_instance'} +# default-centos-7-master-py3: {extends: '.test_instance'} +# repo-centos-7-master-py3: {extends: '.test_instance'} +centos-7-master-py3: {extends: '.test_instance'} +# default-fedora-34-master-py3: {extends: '.test_instance'} +# repo-fedora-34-master-py3: {extends: '.test_instance'} +fedora-34-master-py3: {extends: '.test_instance'} +# default-fedora-33-master-py3: {extends: '.test_instance'} +# repo-fedora-33-master-py3: {extends: '.test_instance'} +fedora-33-master-py3: {extends: '.test_instance'} +# default-opensuse-leap-153-master-py3: {extends: '.test_instance'} +# repo-opensuse-leap-153-master-py3: {extends: '.test_instance'} +opensuse-leap-153-master-py3: {extends: '.test_instance'} +# default-opensuse-leap-152-master-py3: {extends: '.test_instance'} +# repo-opensuse-leap-152-master-py3: {extends: '.test_instance_failure_permitted'} +opensuse-leap-152-master-py3: {extends: '.test_instance_failure_permitted'} default-opensuse-tmbl-latest-master-py3: {extends: '.test_instance'} -default-amazonlinux-2-master-py3: {extends: '.test_instance'} -default-oraclelinux-8-master-py3: {extends: '.test_instance'} -default-oraclelinux-7-master-py3: {extends: '.test_instance'} +# opensuse-tmbl-latest-master-py3: {extends: '.test_instance'} +# default-amazonlinux-2-master-py3: {extends: '.test_instance'} +# repo-amazonlinux-2-master-py3: {extends: '.test_instance'} +amazonlinux-2-master-py3: {extends: '.test_instance'} +# default-oraclelinux-8-master-py3: {extends: '.test_instance'} +# repo-oraclelinux-8-master-py3: {extends: '.test_instance'} +oraclelinux-8-master-py3: {extends: '.test_instance'} +# default-oraclelinux-7-master-py3: {extends: '.test_instance'} +# repo-oraclelinux-7-master-py3: {extends: '.test_instance'} +oraclelinux-7-master-py3: {extends: '.test_instance'} default-arch-base-latest-master-py3: {extends: '.test_instance'} +# arch-base-latest-master-py3: {extends: '.test_instance'} # default-gentoo-stage3-latest-master-py3: {extends: '.test_instance'} +# gentoo-stage3-latest-master-py3: {extends: '.test_instance'} # default-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'} -default-almalinux-8-master-py3: {extends: '.test_instance'} -default-rockylinux-8-master-py3: {extends: '.test_instance'} +# gentoo-stage3-systemd-master-py3: {extends: '.test_instance'} +# default-almalinux-8-master-py3: {extends: '.test_instance'} +# repo-almalinux-8-master-py3: {extends: '.test_instance'} +almalinux-8-master-py3: {extends: '.test_instance'} +# default-rockylinux-8-master-py3: {extends: '.test_instance'} +# repo-rockylinux-8-master-py3: {extends: '.test_instance'} +rockylinux-8-master-py3: {extends: '.test_instance'} # default-debian-11-3003-1-py3: {extends: '.test_instance'} # default-debian-10-3003-1-py3: {extends: '.test_instance'} # default-debian-9-3003-1-py3: {extends: '.test_instance'} diff --git a/.travis.yml b/.travis.yml index 570686274224e0f1ad4484316040fc5e1d22b7f5..df037e794ef8c9485fded5d568714abbf6d90f8a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -95,26 +95,62 @@ jobs: # - env: INSTANCE=default-oraclelinux-7-tiamat-py3 # - env: INSTANCE=default-almalinux-8-tiamat-py3 # - env: INSTANCE=default-rockylinux-8-tiamat-py3 - - env: INSTANCE=default-debian-11-master-py3 - - env: INSTANCE=default-debian-10-master-py3 - - env: INSTANCE=default-debian-9-master-py3 - - env: INSTANCE=default-ubuntu-2004-master-py3 - - env: INSTANCE=default-ubuntu-1804-master-py3 - - env: INSTANCE=default-centos-8-master-py3 - - env: INSTANCE=default-centos-7-master-py3 - - env: INSTANCE=default-fedora-34-master-py3 - - env: INSTANCE=default-fedora-33-master-py3 - - env: INSTANCE=default-opensuse-leap-153-master-py3 - - env: INSTANCE=default-opensuse-leap-152-master-py3 + # - env: INSTANCE=default-debian-11-master-py3 + # - env: INSTANCE=repo-debian-11-master-py3 + - env: INSTANCE=debian-11-master-py3 + # - env: INSTANCE=default-debian-10-master-py3 + # - env: INSTANCE=repo-debian-10-master-py3 + - env: INSTANCE=debian-10-master-py3 + # - env: INSTANCE=default-debian-9-master-py3 + # - env: INSTANCE=repo-debian-9-master-py3 + - env: INSTANCE=debian-9-master-py3 + # - env: INSTANCE=default-ubuntu-2004-master-py3 + # - env: INSTANCE=repo-ubuntu-2004-master-py3 + - env: INSTANCE=ubuntu-2004-master-py3 + # - env: INSTANCE=default-ubuntu-1804-master-py3 + # - env: INSTANCE=repo-ubuntu-1804-master-py3 + - env: INSTANCE=ubuntu-1804-master-py3 + # - env: INSTANCE=default-centos-8-master-py3 + # - env: INSTANCE=repo-centos-8-master-py3 + - env: INSTANCE=centos-8-master-py3 + # - env: INSTANCE=default-centos-7-master-py3 + # - env: INSTANCE=repo-centos-7-master-py3 + - env: INSTANCE=centos-7-master-py3 + # - env: INSTANCE=default-fedora-34-master-py3 + # - env: INSTANCE=repo-fedora-34-master-py3 + - env: INSTANCE=fedora-34-master-py3 + # - env: INSTANCE=default-fedora-33-master-py3 + # - env: INSTANCE=repo-fedora-33-master-py3 + - env: INSTANCE=fedora-33-master-py3 + # - env: INSTANCE=default-opensuse-leap-153-master-py3 + # - env: INSTANCE=repo-opensuse-leap-153-master-py3 + - env: INSTANCE=opensuse-leap-153-master-py3 + # - env: INSTANCE=default-opensuse-leap-152-master-py3 + # - env: INSTANCE=repo-opensuse-leap-152-master-py3 + - env: INSTANCE=opensuse-leap-152-master-py3 - env: INSTANCE=default-opensuse-tmbl-latest-master-py3 - - env: INSTANCE=default-amazonlinux-2-master-py3 - - env: INSTANCE=default-oraclelinux-8-master-py3 - - env: INSTANCE=default-oraclelinux-7-master-py3 + # - env: INSTANCE=opensuse-tmbl-latest-master-py3 + # - env: INSTANCE=default-amazonlinux-2-master-py3 + # - env: INSTANCE=repo-amazonlinux-2-master-py3 + - env: INSTANCE=amazonlinux-2-master-py3 + # - env: INSTANCE=default-oraclelinux-8-master-py3 + # - env: INSTANCE=repo-oraclelinux-8-master-py3 + - env: INSTANCE=oraclelinux-8-master-py3 + # - env: INSTANCE=default-oraclelinux-7-master-py3 + # - env: INSTANCE=repo-oraclelinux-7-master-py3 + - env: INSTANCE=oraclelinux-7-master-py3 - env: INSTANCE=default-arch-base-latest-master-py3 + # - env: INSTANCE=arch-base-latest-master-py3 # - env: INSTANCE=default-gentoo-stage3-latest-master-py3 + # - env: INSTANCE=gentoo-stage3-latest-master-py3 # - env: INSTANCE=default-gentoo-stage3-systemd-master-py3 - - env: INSTANCE=default-almalinux-8-master-py3 - - env: INSTANCE=default-rockylinux-8-master-py3 + # - env: INSTANCE=gentoo-stage3-systemd-master-py3 + # - env: INSTANCE=default-almalinux-8-master-py3 + # - env: INSTANCE=repo-almalinux-8-master-py3 + - env: INSTANCE=almalinux-8-master-py3 + # - env: INSTANCE=default-rockylinux-8-master-py3 + # - env: INSTANCE=repo-rockylinux-8-master-py3 + - env: INSTANCE=rockylinux-8-master-py3 # - env: INSTANCE=default-debian-11-3003-1-py3 # - env: INSTANCE=default-debian-10-3003-1-py3 # - env: INSTANCE=default-debian-9-3003-1-py3 diff --git a/kitchen.yml b/kitchen.yml index bc0cb65487a501d5788ea9a972a7ba5e37879893..9121fe95924b7b03c5e30bc4180dbd5fa61cc299 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -445,3 +445,103 @@ suites: verifier: inspec_tests: - path: test/integration/default + - name: repo + includes: + - debian-11-tiamat-py3 + - debian-10-tiamat-py3 + - debian-9-tiamat-py3 + - ubuntu-2004-tiamat-py3 + - ubuntu-1804-tiamat-py3 + - centos-8-tiamat-py3 + - centos-7-tiamat-py3 + - amazonlinux-2-tiamat-py3 + - oraclelinux-8-tiamat-py3 + - oraclelinux-7-tiamat-py3 + - almalinux-8-tiamat-py3 + - rockylinux-8-tiamat-py3 + - debian-11-master-py3 + - debian-10-master-py3 + - debian-9-master-py3 + - ubuntu-2004-master-py3 + - ubuntu-1804-master-py3 + - centos-8-master-py3 + - centos-7-master-py3 + - fedora-34-master-py3 + - fedora-33-master-py3 + - opensuse-leap-153-master-py3 + - opensuse-leap-152-master-py3 + - amazonlinux-2-master-py3 + - oraclelinux-8-master-py3 + - oraclelinux-7-master-py3 + - almalinux-8-master-py3 + - rockylinux-8-master-py3 + - debian-11-3003-1-py3 + - debian-10-3003-1-py3 + - debian-9-3003-1-py3 + - ubuntu-2004-3003-1-py3 + - ubuntu-1804-3003-1-py3 + - centos-8-3003-1-py3 + - centos-7-3003-1-py3 + - fedora-34-3003-1-py3 + - fedora-33-3003-1-py3 + - opensuse-leap-153-3003-1-py3 + - opensuse-leap-152-3003-1-py3 + - amazonlinux-2-3003-1-py3 + - oraclelinux-8-3003-1-py3 + - oraclelinux-7-3003-1-py3 + - debian-11-3002-6-py3 + - debian-10-3002-6-py3 + - debian-9-3002-6-py3 + - ubuntu-2004-3002-6-py3 + - ubuntu-1804-3002-6-py3 + - centos-8-3002-6-py3 + - centos-7-3002-6-py3 + - fedora-34-3002-6-py3 + - fedora-33-3002-6-py3 + - amazonlinux-2-3002-6-py3 + - oraclelinux-8-3002-6-py3 + - oraclelinux-7-3002-6-py3 + - opensuse-leap-153-3002-2-py3 + - opensuse-leap-152-3002-2-py3 + - debian-10-3001-7-py3 + - debian-9-3001-7-py3 + - ubuntu-2004-3001-7-py3 + - ubuntu-1804-3001-7-py3 + - centos-8-3001-7-py3 + - centos-7-3001-7-py3 + - fedora-34-3001-7-py3 + - fedora-33-3001-7-py3 + - opensuse-leap-153-3001-7-py3 + - opensuse-leap-152-3001-7-py3 + - amazonlinux-2-3001-7-py3 + - oraclelinux-8-3001-7-py3 + - oraclelinux-7-3001-7-py3 + - debian-10-3000-9-py3 + - debian-9-3000-9-py3 + - ubuntu-1804-3000-9-py3 + - centos-8-3000-9-py3 + - centos-7-3000-9-py3 + - opensuse-leap-153-3000-9-py3 + - opensuse-leap-152-3000-9-py3 + - amazonlinux-2-3000-9-py3 + - oraclelinux-8-3000-9-py3 + - oraclelinux-7-3000-9-py3 + - ubuntu-1804-3000-9-py2 + provisioner: + state_top: + base: + '*': + - postgres._mapdata + - postgres + pillars: + top.sls: + base: + '*': + - postgres + - repo + pillars_from_files: + postgres.sls: test/salt/pillar/postgres.sls + repo.sls: test/salt/pillar/repo.sls + verifier: + inspec_tests: + - path: test/integration/repo diff --git a/postgres/codenamemap.yaml b/postgres/codenamemap.yaml index 2f7ca0a04ea4da6ecfa4fc8175adf94d83db5cda..fbfc5fd187269ee8424960ec22245533f2052dd9 100644 --- a/postgres/codenamemap.yaml +++ b/postgres/codenamemap.yaml @@ -78,10 +78,17 @@ {{ debian_codename('focal', '12') }} ## Fedora -# http://apt.postgresql.org/pub/repos/yum/reporpms/ +# https://download.postgresql.org/pub/repos/yum/13/fedora/ # https://apps.fedoraproject.org/packages/postgresql -# `oscodename` grain has long distro name -{{ fedora_codename('Fedora-31', '11', 'Fedora 31 (Thirty One)') }} -{{ fedora_codename('Fedora-30', '11', 'Fedora 30 (Thirty)') }} +{{ fedora_codename('Fedora-34', '13') }} +{{ fedora_codename('Fedora-33', '13') }} + +## Amazon +Amazon Linux 2: + pkgs_deps: + - libicu + - systemd-sysv + pkg_repo: + baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/redhat/rhel-7-$basearch' # vim: ft=sls diff --git a/postgres/osfamilymap.yaml b/postgres/osfamilymap.yaml index d5193348cc35231864eddd6ccd8ed149e48f97b5..e572e94a656902cdd9ddeb0950342770ea5f004f 100644 --- a/postgres/osfamilymap.yaml +++ b/postgres/osfamilymap.yaml @@ -63,11 +63,12 @@ RedHat: gpgkey: 'https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-{{ release }}' baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/redhat/rhel-$releasever-$basearch' -{%- if grains.get('osmajorrelease', 0) >= 7 %} pkgs_deps: - libicu + {%- if grains.get('osmajorrelease', 0) == 7 %} + - systemd-sysv + {%- endif %} pkg_python: python3-psycopg2 -{%- endif %} {% if repo.use_upstream_repo == true %} {% set data_dir = '/var/lib/pgsql/' ~ repo.version ~ '/data' %} diff --git a/postgres/osmap.yaml b/postgres/osmap.yaml index fd885e5c5616b170ee0d051d4c86a90fa3f237dc..4fb1309dfe61a526c141201fcfe6059a881aa70f 100644 --- a/postgres/osmap.yaml +++ b/postgres/osmap.yaml @@ -9,7 +9,3 @@ Fedora: baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/fedora/fedora-$releasever-$basearch' remove: releases: ['9.4', '9.5', '9.6', '10'] - -Amazon: - pkg_repo: - baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/redhat/rhel-7-$basearch' diff --git a/test/integration/default/controls/services.rb b/test/integration/default/controls/services.rb new file mode 100644 index 0000000000000000000000000000000000000000..2c3d6e1211bdfe8a00413fac993de07901126c49 --- /dev/null +++ b/test/integration/default/controls/services.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +service_name = 'postgresql' + +pg_port = + case platform[:family] + when 'debian', 'suse' + 5433 + else + 5432 + end + +control 'Postgres service' do + impact 0.5 + title 'should be installed, enabled and running' + + describe service(service_name) do + it { should be_installed } + it { should be_enabled } + it { should be_running } + end + + describe port(pg_port) do + it { should be_listening } + end +end diff --git a/test/integration/default/controls/services_spec.rb b/test/integration/default/controls/services_spec.rb deleted file mode 100644 index 5dfd78e5287fa0c56ad115f3ff442d36846f4577..0000000000000000000000000000000000000000 --- a/test/integration/default/controls/services_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -# Overide by Platform -service_name = 'postgresql' -pg_port = 5432 -if (platform[:name] == 'centos') && platform[:release].start_with?('6') - service_name = 'postgresql-9.6' -elsif (platform[:family] == 'debian') || (platform[:family] == 'suse') - pg_port = 5433 -end - -control 'Postgres service' do - impact 0.5 - title 'should be running and enabled' - - describe service(service_name) do - it { should be_enabled } - it { should be_running } - end - - describe port(pg_port) do - it { should be_listening } - end -end diff --git a/test/integration/default/controls/share.rb b/test/integration/default/controls/share.rb new file mode 100644 index 0000000000000000000000000000000000000000..362f11c262735a65c8b3384a83b58b673e49924d --- /dev/null +++ b/test/integration/default/controls/share.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# https://docs.chef.io/inspec/profiles/#including-all-controls-from-a-profile +# Could use `include_controls` in this scenario +# include_controls 'share' + +# https://docs.chef.io/inspec/profiles/#selectively-including-controls-from-a-profile +# However, using `require_controls` for more clarity +require_controls 'share' do + control 'Postgres command' + control 'Postgres configuration' + # control 'Postgres service' +end diff --git a/test/integration/repo/README.md b/test/integration/repo/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7a125250ac28a31f08e3b2b156b3cb62751fd8ab --- /dev/null +++ b/test/integration/repo/README.md @@ -0,0 +1,50 @@ +# InSpec Profile: `repo` + +This shows the implementation of the `repo` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). + +## Verify a profile + +InSpec ships with built-in features to verify a profile structure. + +```bash +$ inspec check repo +Summary +------- +Location: repo +Profile: profile +Controls: 4 +Timestamp: 2019-06-24T23:09:01+00:00 +Valid: true + +Errors +------ + +Warnings +-------- +``` + +## Execute a profile + +To run all **supported** controls on a local machine use `inspec exec /path/to/profile`. + +```bash +$ inspec exec repo +.. + +Finished in 0.0025 seconds (files took 0.12449 seconds to load) +8 examples, 0 failures +``` + +## Execute a specific control from a profile + +To run one control from the profile use `inspec exec /path/to/profile --controls name`. + +```bash +$ inspec exec repo --controls package +. + +Finished in 0.0025 seconds (files took 0.12449 seconds to load) +1 examples, 0 failures +``` + +See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb). diff --git a/test/integration/repo/controls/services.rb b/test/integration/repo/controls/services.rb new file mode 100644 index 0000000000000000000000000000000000000000..e1927db028339dc0b344061b807e201f15099488 --- /dev/null +++ b/test/integration/repo/controls/services.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +service_name = + case platform[:family] + when 'redhat', 'fedora', 'suse' + case system.platform[:release] + when 'tumbleweed' + 'postgresql' + else + 'postgresql-13' + end + else + 'postgresql' + end + +pg_port = + case platform[:family] + when 'debian', 'suse' + 5433 + else + 5432 + end + +control 'Postgres service' do + impact 0.5 + title 'should be installed, enabled and running' + + describe service(service_name) do + it { should be_installed } + it { should be_enabled } + it { should be_running } + end + + describe port(pg_port) do + it { should be_listening } + end +end diff --git a/test/integration/repo/controls/share.rb b/test/integration/repo/controls/share.rb new file mode 100644 index 0000000000000000000000000000000000000000..362f11c262735a65c8b3384a83b58b673e49924d --- /dev/null +++ b/test/integration/repo/controls/share.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# https://docs.chef.io/inspec/profiles/#including-all-controls-from-a-profile +# Could use `include_controls` in this scenario +# include_controls 'share' + +# https://docs.chef.io/inspec/profiles/#selectively-including-controls-from-a-profile +# However, using `require_controls` for more clarity +require_controls 'share' do + control 'Postgres command' + control 'Postgres configuration' + # control 'Postgres service' +end diff --git a/test/integration/repo/inspec.yml b/test/integration/repo/inspec.yml new file mode 100644 index 0000000000000000000000000000000000000000..635d0f0d3cde1526b49f5cf8e000e15a2003b5a7 --- /dev/null +++ b/test/integration/repo/inspec.yml @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +name: repo +title: postgres formula +maintainer: SaltStack Formulas +license: Apache-2.0 +# yamllint disable-line rule:line-length +summary: Verify that the postgres formula is setup and configured correctly (when installing from the upstream repo) +depends: + - name: share + path: test/integration/share +supports: + - platform-name: debian + - platform-name: ubuntu + - platform-name: centos + - platform-name: fedora + - platform-name: opensuse + - platform-name: suse + - platform-name: freebsd + - platform-name: openbsd + - platform-name: amazon + - platform-name: oracle + - platform-name: arch + - platform-name: gentoo + - platform-name: almalinux + - platform-name: rocky + - platform: windows diff --git a/test/integration/default/controls/command_spec.rb b/test/integration/share/controls/command.rb similarity index 100% rename from test/integration/default/controls/command_spec.rb rename to test/integration/share/controls/command.rb diff --git a/test/integration/default/controls/config_spec.rb b/test/integration/share/controls/config.rb similarity index 100% rename from test/integration/default/controls/config_spec.rb rename to test/integration/share/controls/config.rb diff --git a/test/salt/pillar/postgres.sls b/test/salt/pillar/postgres.sls index 3bfa7963ca5e3ab5b08c8c26c945841730841185..da4e734476f198041f8abbdf70055e753093fa8c 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 0000000000000000000000000000000000000000..a4445e7a3d0fe92baf35bc7802297fd72265290c --- /dev/null +++ b/test/salt/pillar/repo.sls @@ -0,0 +1,4 @@ +--- +postgres: + use_upstream_repo: true + version: '13'