65 Commits

Author SHA1 Message Date
semantic-release-bot
3d5564843d chore(release): 0.40.4 [skip ci]
## [0.40.4](https://github.com/saltstack-formulas/postgres-formula/compare/v0.40.3...v0.40.4) (2019-10-11)

### Bug Fixes

* **rubocop:** add fixes using `rubocop --safe-auto-correct` ([](https://github.com/saltstack-formulas/postgres-formula/commit/37b0c43))
* **rubocop:** fix remaining errors manually ([](https://github.com/saltstack-formulas/postgres-formula/commit/b369aa9))

### Continuous Integration

* merge travis matrix, add `salt-lint` & `rubocop` to `lint` job ([](https://github.com/saltstack-formulas/postgres-formula/commit/7822200))
* **travis:** merge `rubocop` linter into main `lint` job ([](https://github.com/saltstack-formulas/postgres-formula/commit/2c82872))
2019-10-11 12:28:44 +00:00
Imran Iqbal
ddd1693e50 Merge pull request #292 from myii/ci/merge-rubocop-linter
ci(travis): merge `rubocop` linter into main `lint` job
2019-10-11 13:14:03 +01:00
Imran Iqbal
2c82872dd9 ci(travis): merge rubocop linter into main lint job
* Semi-automated using https://github.com/myii/ssf-formula/pull/64
2019-10-11 12:57:42 +01:00
Imran Iqbal
b369aa9d40 fix(rubocop): fix remaining errors manually 2019-10-11 12:52:29 +01:00
Imran Iqbal
37b0c43839 fix(rubocop): add fixes using rubocop --safe-auto-correct 2019-10-11 12:50:13 +01:00
Imran Iqbal
911317c9ec chore(issues): remove issues templates to use org-level templates [skip ci]
* Automated using https://github.com/myii/ssf-formula/pull/61
2019-10-10 15:28:09 +01:00
semantic-release-bot
a4c84df77e chore(release): 0.40.3 [skip ci]
## [0.40.3](https://github.com/saltstack-formulas/postgres-formula/compare/v0.40.2...v0.40.3) (2019-10-10)

### Bug Fixes

* **manage.sls:** fix `salt-lint` errors ([](https://github.com/saltstack-formulas/postgres-formula/commit/bf5b4d6))
* **python.sls:** fix `salt-lint` errors ([](https://github.com/saltstack-formulas/postgres-formula/commit/1f3cfcc))

### Continuous Integration

* **kitchen:** change `log_level` to `debug` instead of `info` ([](https://github.com/saltstack-formulas/postgres-formula/commit/7ca61f3))
* **kitchen:** install required packages to bootstrapped `opensuse` [skip ci] ([](https://github.com/saltstack-formulas/postgres-formula/commit/76e3e39))
* **kitchen:** use bootstrapped `opensuse` images until `2019.2.2` [skip ci] ([](https://github.com/saltstack-formulas/postgres-formula/commit/3a27978))
* **platform:** add `arch-base-latest` (commented out for now) [skip ci] ([](https://github.com/saltstack-formulas/postgres-formula/commit/89e4a34))
* merge travis matrix, add `salt-lint` & `rubocop` to `lint` job ([](https://github.com/saltstack-formulas/postgres-formula/commit/a0fdd48))
2019-10-10 03:39:05 +00:00
Imran Iqbal
cd6eb0be16 Merge pull request #291 from myii/ci/merge-matrix-and-add-salt-lint-and-rubocop
ci: merge travis matrix, add `salt-lint` & `rubocop` to `lint` job
2019-10-09 23:51:09 +01:00
Imran Iqbal
a0fdd48ebb ci: merge travis matrix, add salt-lint & rubocop to lint job
* Semi-automated using https://github.com/myii/ssf-formula/pull/60
2019-10-09 18:09:32 +01:00
Imran Iqbal
1f3cfccc0d fix(python.sls): fix salt-lint errors
```bash
Examining postgres/python.sls of type state
[206] Jinja variables should have spaces before and after: {{ var_name }}
postgres/python.sls:8
    - name: {{ postgres.pkg_python}}
```
2019-10-09 18:08:20 +01:00
Imran Iqbal
bf5b4d6fd7 fix(manage.sls): fix salt-lint errors
```bash
Examining postgres/manage.sls of type state
[201] Trailing whitespace
postgres/manage.sls:57

[201] Trailing whitespace
postgres/manage.sls:67
```
2019-10-09 18:08:20 +01:00
Imran Iqbal
7822200a58 ci: merge travis matrix, add salt-lint & rubocop to lint job
* Automated using https://github.com/myii/ssf-formula/pull/60
2019-10-08 16:38:21 +01:00
Imran Iqbal
e546fc3476 chore(yamllint): update ignored paths and add octal-values [skip ci]
* Automated using https://github.com/myii/ssf-formula/pull/59
2019-10-07 19:34:02 +01:00
Imran Iqbal
4975410ca9 chore(issues): update Bug report & Feature request templates [skip ci]
* Automated using https://github.com/myii/ssf-formula/pull/58
2019-10-07 15:28:19 +01:00
Imran Iqbal
76e3e3983d ci(kitchen): install required packages to bootstrapped opensuse [skip ci]
* Automated using https://github.com/myii/ssf-formula/pull/53
2019-10-02 00:09:21 +01:00
Imran Iqbal
3a27978204 ci(kitchen): use bootstrapped opensuse images until 2019.2.2 [skip ci]
* Automated using https://github.com/myii/ssf-formula/pull/52
2019-10-01 21:35:57 +01:00
Imran Iqbal
89e4a34d3d ci(platform): add arch-base-latest (commented out for now) [skip ci]
* Automated using https://github.com/myii/ssf-formula/pull/50
2019-10-01 16:22:29 +01:00
Imran Iqbal
934e8ff250 chore(issues): provide Bug report & Feature request templates [skip ci]
* Automated using https://github.com/myii/ssf-formula/pull/48
2019-09-30 16:00:52 +01:00
Imran Iqbal
7ca61f3fbb ci(kitchen): change log_level to debug instead of info
* Automated using https://github.com/myii/ssf-formula/pull/41
2019-09-23 17:01:53 +01:00
semantic-release-bot
4c1f76f2ff chore(release): 0.40.2 [skip ci]
## [0.40.2](https://github.com/saltstack-formulas/postgres-formula/compare/v0.40.1...v0.40.2) (2019-09-13)

### Bug Fixes

* **freebsd:** no libpqdev freebsd package ([eca6d97](https://github.com/saltstack-formulas/postgres-formula/commit/eca6d97))

### Continuous Integration

* **yamllint:** add rule `empty-values` & use new `yaml-files` setting ([9796319](https://github.com/saltstack-formulas/postgres-formula/commit/9796319))
2019-09-13 22:02:38 +00:00
Nicolas Rodriguez
f99f2a0735 Merge pull request #289 from noelmcloughlin/freebsd
fix(freebsd): no libpqdev freebsd package
2019-09-13 23:48:20 +02:00
Niels Abspoel
980ae5b42e Merge pull request #287 from myii/chore/standardise-structure
ci(yamllint): add rule `empty-values` & use new `yaml-files` setting
2019-09-12 18:13:53 +02:00
N
eca6d97e59 fix(freebsd): no libpqdev freebsd package 2019-09-11 14:39:03 +01:00
semantic-release-bot
5c21924335 chore(release): 0.40.1 [skip ci]
## [0.40.1](https://github.com/saltstack-formulas/postgres-formula/compare/v0.40.0...v0.40.1) (2019-09-11)

### Continuous Integration

* use `dist: bionic` & apply `opensuse-leap-15` SCP error workaround ([fc6cbe0](https://github.com/saltstack-formulas/postgres-formula/commit/fc6cbe0))

### Documentation

* **pillar.example:** update examples for freebsd ([a799214](https://github.com/saltstack-formulas/postgres-formula/commit/a799214))
2019-09-11 10:01:48 +00:00
N
81b1ed15c0 Merge pull request #288 from noelmcloughlin/archlinux
docs(pillar.example): update examples for freebsd
2019-09-11 11:47:49 +02:00
N
a799214c34 docs(pillar.example): update examples for freebsd 2019-09-10 12:24:00 +01:00
Imran Iqbal
9796319a3f ci(yamllint): add rule empty-values & use new yaml-files setting
* Automated using https://github.com/myii/ssf-formula/pull/27
2019-09-10 05:56:02 +01:00
Niels Abspoel
6e0245a9e7 Merge pull request #286 from myii/chore/standardise-structure
ci: use `dist: bionic` & apply `opensuse-leap-15` SCP error workaround
2019-09-08 21:43:34 +02:00
Imran Iqbal
fc6cbe0ab9 ci: use dist: bionic & apply opensuse-leap-15 SCP error workaround
* Automated using https://github.com/myii/ssf-formula/pull/22
2019-09-07 03:39:43 +01:00
semantic-release-bot
4c80c3641a chore(release): 0.40.0 [skip ci]
# [0.40.0](https://github.com/saltstack-formulas/postgres-formula/compare/v0.39.1...v0.40.0) (2019-09-03)

### Features

* **archlinux:** add support, fixing rendering errors ([e970925](https://github.com/saltstack-formulas/postgres-formula/commit/e970925))
2019-09-03 18:39:35 +00:00
Niels Abspoel
3df38b1be2 Merge pull request #280 from noelmcloughlin/archlinux
feat(archlinux): add support, fixing rendering errors
2019-09-03 20:29:24 +02:00
N
e9709254c6 feat(archlinux): add support, fixing rendering errors 2019-09-03 14:36:16 +01:00
semantic-release-bot
85a5dca346 chore(release): 0.39.1 [skip ci]
## [0.39.1](https://github.com/saltstack-formulas/postgres-formula/compare/v0.39.0...v0.39.1) (2019-09-01)

### Continuous Integration

* **kitchen+travis:** replace EOL pre-salted images ([140928b](https://github.com/saltstack-formulas/postgres-formula/commit/140928b))

### Tests

* **inspec:** fix reference to `suse` after gem `train` update ([677adba](https://github.com/saltstack-formulas/postgres-formula/commit/677adba))
2019-09-01 11:09:44 +00:00
Niels Abspoel
aa96c783bb Merge pull request #285 from myii/chore/standardise-structure
ci(kitchen+travis): replace EOL pre-salted images
2019-09-01 11:42:37 +02:00
Imran Iqbal
140928bfc2 ci(kitchen+travis): replace EOL pre-salted images
* Automated using https://github.com/myii/ssf-formula/pull/16
2019-08-28 07:40:17 +01:00
Imran Iqbal
677adbae16 test(inspec): fix reference to suse after gem train update
* https://github.com/inspec/train/pull/505
2019-08-28 07:39:55 +01:00
Imran Iqbal
766596e175 Merge pull request #284 from myii/chore/standardise-structure
chore: use `semantic-release` cross-formula standard structure
2019-08-17 16:46:14 +01:00
Imran Iqbal
5160365a71 chore: use semantic-release cross-formula standard structure
* Automated using `ssf-formula` (v0.6.0)
2019-08-17 16:06:31 +01:00
semantic-release-bot
e81c633b4e chore(release): 0.39.0 [skip ci]
# [0.39.0](https://github.com/saltstack-formulas/postgres-formula/compare/v0.38.0...v0.39.0) (2019-08-17)

### Features

* **yamllint:** include for this repo and apply rules throughout ([1f0fd92](https://github.com/saltstack-formulas/postgres-formula/commit/1f0fd92))
2019-08-17 09:19:19 +00:00
Niels Abspoel
19b6efbb33 Merge pull request #283 from myii/chore/standardise-structure
feat(yamllint): include for this repo and apply rules throughout
2019-08-17 09:51:18 +02:00
Imran Iqbal
1f0fd92674 feat(yamllint): include for this repo and apply rules throughout
* Semi-automated using `ssf-formula` (v0.5.0)
* Fix (or ignore) errors shown below:

```bash
postgres-formula$ $(grep "\- yamllint" .travis.yml | sed -e "s:^\s\+-\s\(.*\):\1:")
./postgres/repo.yaml
  4:2       error    syntax error: found character '%' that cannot start any token
  6:89      error    line too long (110 > 88 characters)  (line-length)
  9:89      error    line too long (95 > 88 characters)  (line-length)
  13:89     error    line too long (104 > 88 characters)  (line-length)
  14:89     error    line too long (106 > 88 characters)  (line-length)

./postgres/defaults.yaml
  3:1       warning  missing document start "---"  (document-start)
  4:22      warning  truthy value should be one of [false, true]  (truthy)
  5:16      warning  truthy value should be one of [false, true]  (truthy)
  5:22      warning  too few spaces before comment  (comments)
  20:10     warning  truthy value should be one of [false, true]  (truthy)
  40:8      warning  missing starting space in comment  (comments)
  41:89     error    line too long (97 > 88 characters)  (line-length)
  71:11     error    too many spaces after colon  (colons)
  72:12     warning  truthy value should be one of [false, true]  (truthy)
  74:15     warning  truthy value should be one of [false, true]  (truthy)
  85:6      warning  missing starting space in comment  (comments)
  89:11     warning  truthy value should be one of [false, true]  (truthy)
  90:24     warning  truthy value should be one of [false, true]  (truthy)
  91:56     error    too few spaces after comma  (commas)

./postgres/codenamemap.yaml
  3:2       error    syntax error: found character '%' that cannot start any token
  8:89      error    line too long (98 > 88 characters)  (line-length)
  49:89     error    line too long (110 > 88 characters)  (line-length)
  53:89     error    line too long (99 > 88 characters)  (line-length)

./postgres/osmap.yaml
  1:2       error    syntax error: found character '%' that cannot start any token
  5:89      error    line too long (115 > 88 characters)  (line-length)

./postgres/osfamilymap.yaml
  1:2       error    syntax error: found character '%' that cannot start any token
  57:89     error    line too long (90 > 88 characters)  (line-length)
  58:89     error    line too long (113 > 88 characters)  (line-length)
  134:89    error    line too long (103 > 88 characters)  (line-length)
  135:89    error    line too long (127 > 88 characters)  (line-length)
  205:89    error    line too long (91 > 88 characters)  (line-length)
  206:89    error    line too long (91 > 88 characters)  (line-length)

pillar.example
  3:1       warning  missing document start "---"  (document-start)
  8:22      warning  truthy value should be one of [false, true]  (truthy)
  13:16     warning  truthy value should be one of [false, true]  (truthy)
  20:4      warning  missing starting space in comment  (comments)
  21:4      warning  missing starting space in comment  (comments)
  42:4      warning  missing starting space in comment  (comments)
  65:4      warning  missing starting space in comment  (comments)
  87:4      error    syntax error: found character '%' that cannot start any token

test/salt/pillar/postgres.sls
  4:2       error    syntax error: found character '%' that cannot start any token
```
2019-08-16 17:00:02 +01:00
Imran Iqbal
115f638107 Merge pull request #279 from myii/ci/standardise-structure
chore: use `semantic-release` cross-formula standard structure
2019-07-25 22:07:38 +01:00
Imran Iqbal
84eef0cf07 chore: use semantic-release cross-formula standard structure
* Automated using `ssf-formula` (v0.1.0-rc.2)
2019-07-25 09:36:51 +01:00
semantic-release-bot
5df8f79dc1 chore(release): 0.38.0 [skip ci]
# [0.38.0](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.4...v0.38.0) (2019-07-24)

### Continuous Integration

* **kitchen:** remove `python*-pip` installation ([d999597](https://github.com/saltstack-formulas/postgres-formula/commit/d999597))
* **kitchen+travis:** modify matrix to include `develop` platform ([3f81439](https://github.com/saltstack-formulas/postgres-formula/commit/3f81439))

### Features

* **debian:** add buster support ([904ba27](https://github.com/saltstack-formulas/postgres-formula/commit/904ba27))
2019-07-24 20:40:03 +00:00
N
0046482adf Merge pull request #278 from saltstack-formulas/add-debian-buster-support
feat(debian): add buster support
2019-07-24 21:28:44 +01:00
John Keates
904ba271ca feat(debian): add buster support 2019-07-24 22:12:26 +02:00
John Keates
e5700f48c5 Update codenamemap.yaml 2019-07-24 20:14:35 +02:00
Niels Abspoel
aa492c3ba9 Merge pull request #275 from myii/ci/standardise-structure
chore: use `semantic-release` cross-formula standard structure
2019-07-23 21:01:18 +02:00
Imran Iqbal
72ff82ce75 chore: use semantic-release cross-formula standard structure
* Automated using `ssf-formula` (v0.1.0-rc.1)
2019-07-19 12:34:38 +01:00
Imran Iqbal
5e631bf7d8 Merge pull request #272 from myii/chore/update-pre-salted-images
ci(kitchen): remove `python*-pip` installation
2019-06-28 02:32:49 +01:00
Imran Iqbal
d999597a91 ci(kitchen): remove python*-pip installation
* Now available in pre-salted images
2019-06-27 22:38:28 +01:00
Imran Iqbal
45a921dc4e Merge pull request #271 from myii/chore/use-develop-image-in-matrix
ci(kitchen+travis): modify matrix to include `develop` platform
2019-06-26 04:10:04 +01:00
Imran Iqbal
3f81439991 ci(kitchen+travis): modify matrix to include develop platform
* Use balanced matrix based on `template-formula` guidelines
* Initial ref: https://github.com/saltstack-formulas/template-formula/issues/118
2019-06-26 03:52:07 +01:00
semantic-release-bot
44b8fb1bc2 chore(release): 0.37.4 [skip ci]
## [0.37.4](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.3...v0.37.4) (2019-05-31)

### Continuous Integration

* **travis:** reduce matrix down to 6 instances ([2ff919f](https://github.com/saltstack-formulas/postgres-formula/commit/2ff919f))

### Tests

* **`services_spec`:** remove temporary `suse` conditional ([81165fc](https://github.com/saltstack-formulas/postgres-formula/commit/81165fc))
* **command_spec:** use cleaner `match` string using `%r` ([a054cea](https://github.com/saltstack-formulas/postgres-formula/commit/a054cea))
* **locale:** improve test using locale `en_US.UTF-8` ([7796064](https://github.com/saltstack-formulas/postgres-formula/commit/7796064))
2019-05-31 17:53:44 +00:00
Imran Iqbal
cb4e405098 Merge pull request #269 from myii/chore/test-locales
test(locale): improve test using locale `en_US.UTF-8`
2019-05-31 18:37:23 +01:00
Imran Iqbal
2ff919f1bf ci(travis): reduce matrix down to 6 instances
* Ref: https://github.com/saltstack-formulas/template-formula/pull/121
2019-05-31 02:19:35 +01:00
Imran Iqbal
81165fc405 test(services_spec): remove temporary suse conditional
* `train` gem has been fixed upstream
  - https://github.com/inspec/train/pull/451
  - https://rubygems.org/gems/train/versions/2.1.7
2019-05-31 02:15:57 +01:00
Javier Bértoli
a054cea962 test(command_spec): use cleaner match string using %r 2019-05-31 02:08:10 +01:00
Imran Iqbal
77960641dd test(locale): improve test using locale en_US.UTF-8 2019-05-31 02:08:08 +01:00
semantic-release-bot
cb8de937a5 chore(release): 0.37.3 [skip ci]
## [0.37.3](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.2...v0.37.3) (2019-05-16)

### Bug Fixes

* **freebsd-user:** fix FreeBSD daemon's user for PostgreSQL >= 9.6 ([8745365](https://github.com/saltstack-formulas/postgres-formula/commit/8745365)), closes [#263](https://github.com/saltstack-formulas/postgres-formula/issues/263)
2019-05-16 08:05:28 +00:00
Denys Havrysh
5763d220e5 Merge pull request #268 from Strade28/master
fix(freebsd-user): fix FreeBSD daemon's user for PostgreSQL >= 9.6
2019-05-16 10:45:15 +03:00
julien levieil
8745365d71 fix(freebsd-user): fix FreeBSD daemon's user for PostgreSQL >= 9.6
For postgresql 9.6 and newer, the default unix user used by postgresql
daemon has changed to 'postgres', and the default data directory is:
/var/db/postgres/data96

Closes #263
2019-05-16 09:35:35 +11:00
semantic-release-bot
10126fb740 chore(release): 0.37.2 [skip ci]
## [0.37.2](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.1...v0.37.2) (2019-05-12)

### Bug Fixes

* **sysrc-svc:** workaround *BSD minion indefinitely hanging on start ([0aa8b4a](https://github.com/saltstack-formulas/postgres-formula/commit/0aa8b4a))
2019-05-12 22:44:15 +00:00
Imran Iqbal
65519cb06f Merge pull request #264 from sticky-note/master
fix(sysrc-svc): workaround *BSD minion indefinitely hanging on start
2019-05-12 23:24:58 +01:00
sam
0aa8b4a048 fix(sysrc-svc): workaround *BSD minion indefinitely hanging on start
Check https://github.com/saltstack/salt/issues/44848 for further details
2019-05-13 08:44:52 +11:00
35 changed files with 951 additions and 258 deletions

14
.gitignore vendored
View File

@@ -48,6 +48,7 @@ coverage.xml
.kitchen .kitchen
.kitchen.local.yml .kitchen.local.yml
kitchen.local.yml kitchen.local.yml
junit-*.xml
# Translations # Translations
*.mo *.mo
@@ -103,8 +104,19 @@ ENV/
# mypy # mypy
.mypy_cache/ .mypy_cache/
# Bundler
Gemfile.lock
# copied `.md` files used for conversion to `.rst` using `m2r` # copied `.md` files used for conversion to `.rst` using `m2r`
docs/*.md docs/*.md
# Vim # Vim
*.sw[nop] *.sw?
## Collected when centralising formulas (check and sort)
# `collectd-formula`
.pytest_cache/
/.idea/
Dockerfile.*_*
ignore/
tmp/

10
.rubocop.yml Normal file
View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# General overrides used across formulas in the org
Metrics/LineLength:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
Max: 88
# Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config`

13
.salt-lint Normal file
View File

@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
exclude_paths: []
skip_list:
# Using `salt-lint` for linting other files as well, such as Jinja macros/templates
- 205 # Use ".sls" as a Salt State file extension
# Skipping `207` and `208` because `210` is sufficient, at least for the time-being
# I.e. Allows 3-digit unquoted codes to still be used, such as `644` and `755`
- 207 # File modes should always be encapsulated in quotation marks
- 208 # File modes should always contain a leading zero
tags: []
verbosity: 1

View File

@@ -1,61 +1,90 @@
stages: # -*- coding: utf-8 -*-
- test # vim: ft=yaml
- commitlint ---
- name: release ## Machine config
if: branch = master AND type != pull_request dist: bionic
sudo: required sudo: required
cache: bundler
language: ruby
services: services:
- docker - docker
before_install: ## Language and cache config
- bundle install language: ruby
cache: bundler
# Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml`
env:
matrix:
- INSTANCE: default-debian-9-2019-2-py3
# TODO: Re-enable this once the `systemd` service can be restarted reliably
# - INSTANCE: default-ubuntu-1804-2019-2-py3
- INSTANCE: default-centos-7-2019-2-py3
- INSTANCE: default-fedora-29-2019-2-py3
- INSTANCE: default-opensuse-leap-15-2019-2-py3
- INSTANCE: default-debian-9-2018-3-py2
- INSTANCE: default-ubuntu-1604-2018-3-py2
- INSTANCE: default-centos-7-2018-3-py2
- INSTANCE: default-fedora-29-2018-3-py2
# TODO: Use this when fixed instead of `opensuse-423`
# NOTE: Having to temporarily disable `opensuse-423` due to slow mirror
# - INSTANCE: default-opensuse-leap-15-2018-3-py2
# - INSTANCE: default-opensuse-423-2018-3-py2
- INSTANCE: default-debian-8-2017-7-py2
- INSTANCE: default-ubuntu-1604-2017-7-py2
- INSTANCE: default-centos-6-2017-7-py2
- INSTANCE: default-fedora-28-2017-7-py2
- INSTANCE: default-opensuse-leap-42-2017-7-py2
## Script to run for the test stage
script: script:
- bundle exec kitchen verify ${INSTANCE} - bin/kitchen verify "${INSTANCE}"
## Stages and jobs matrix
stages:
- test
- name: release
if: branch = master AND type != pull_request
jobs: jobs:
include: include:
# Define the commitlint stage ## Define the test stage that runs the linters (and testing matrix, if applicable)
- stage: commitlint
language: node_js # Run all of the linters in a single job
- language: node_js
node_js: lts/* node_js: lts/*
env: Lint
name: 'Lint: salt-lint, yamllint, rubocop & commitlint'
before_install: skip before_install: skip
script: script:
# Install and run `salt-lint`
- pip install --user salt-lint
- git ls-files | grep '\.sls$\|\.jinja$\|\.j2$\|\.tmpl$'
| xargs -I {} salt-lint {}
# Install and run `yamllint`
# Need at least `v1.17.0` for the `yaml-files` setting
- pip install --user yamllint>=1.17.0
- yamllint -s .
# Install and run `rubocop`
- gem install rubocop
- rubocop -d
# Install and run `commitlint`
- npm install @commitlint/config-conventional -D - npm install @commitlint/config-conventional -D
- npm install @commitlint/travis-cli -D - npm install @commitlint/travis-cli -D
- commitlint-travis - commitlint-travis
# Define the release stage that runs semantic-release
## Define the rest of the matrix based on Kitchen testing
# Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml`
- env: INSTANCE=default-debian-10-develop-py3
# - env: INSTANCE=default-ubuntu-1804-develop-py3
# - env: INSTANCE=default-centos-7-develop-py3
# - env: INSTANCE=default-fedora-30-develop-py3
# - env: INSTANCE=default-opensuse-leap-15-develop-py3
# - env: INSTANCE=default-amazonlinux-2-develop-py2
# - env: INSTANCE=default-arch-base-latest-develop-py2
# - env: INSTANCE=default-debian-9-2019-2-py3
# - env: INSTANCE=default-ubuntu-1804-2019-2-py3
- env: INSTANCE=default-centos-7-2019-2-py3
- env: INSTANCE=default-fedora-30-2019-2-py3
# - env: INSTANCE=default-opensuse-leap-15-2019-2-py3
# - env: INSTANCE=default-amazonlinux-2-2019-2-py2
# - env: INSTANCE=default-arch-base-latest-2019-2-py2
# - env: INSTANCE=default-debian-9-2018-3-py2
- env: INSTANCE=default-ubuntu-1604-2018-3-py2
# - env: INSTANCE=default-centos-7-2018-3-py2
# - env: INSTANCE=default-fedora-29-2018-3-py2
- env: INSTANCE=default-opensuse-leap-15-2018-3-py2
# - env: INSTANCE=default-amazonlinux-2-2018-3-py2
# - env: INSTANCE=default-arch-base-latest-2018-3-py2
# - env: INSTANCE=default-debian-8-2017-7-py2
# - env: INSTANCE=default-ubuntu-1604-2017-7-py2
- env: INSTANCE=default-centos-6-2017-7-py2
# - env: INSTANCE=default-fedora-29-2017-7-py2
# - env: INSTANCE=default-opensuse-leap-15-2017-7-py2
# - env: INSTANCE=default-amazonlinux-2-2017-7-py2
# - env: INSTANCE=default-arch-base-latest-2017-7-py2
## Define the release stage that runs `semantic-release`
- stage: release - stage: release
language: node_js language: node_js
node_js: lts/* node_js: lts/*
env: Release
name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA'
before_install: skip before_install: skip
script: script:
# Update `AUTHORS.md` # Update `AUTHORS.md`
@@ -73,4 +102,3 @@ jobs:
script: script:
# Run `semantic-release` # Run `semantic-release`
- npx semantic-release@15 - npx semantic-release@15

43
.yamllint Normal file
View File

@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# Extend the `default` configuration provided by `yamllint`
extends: default
# Files to ignore completely
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
# 2. Any SLS files under directory `test/`, which are actually state files
# 3. Any YAML files under directory `.kitchen/`, introduced during local testing
# 4. All YAML files heavily reliant on Jinja; these can be tackled in a subsequent PR
ignore: |
node_modules/
test/**/states/**/*.sls
.kitchen/
pillar.example
postgres/codenamemap.yaml
postgres/osfamilymap.yaml
postgres/osmap.yaml
postgres/repo.yaml
test/salt/pillar/postgres.sls
yaml-files:
# Default settings
- '*.yaml'
- '*.yml'
- .salt-lint
- .yamllint
# SaltStack Formulas additional settings
- '*.example'
- test/**/*.sls
rules:
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
line-length:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
max: 88
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true

View File

@@ -4,23 +4,23 @@ This list is sorted by the number of commits per contributor in _descending_ ord
Avatar|Contributor|Contributions Avatar|Contributor|Contributions
:-:|---|:-: :-:|---|:-:
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>|[@noelmcloughlin](https://github.com/noelmcloughlin)|57 <img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/10231489?v=4' width='36' height='36' alt='@myii'>|[@myii](https://github.com/myii)|72
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1800660?v=4' width='36' height='36' alt='@aboe76'>|[@aboe76](https://github.com/aboe76)|47 <img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>|[@noelmcloughlin](https://github.com/noelmcloughlin)|62
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1800660?v=4' width='36' height='36' alt='@aboe76'>|[@aboe76](https://github.com/aboe76)|53
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1396878?v=4' width='36' height='36' alt='@gravyboat'>|[@gravyboat](https://github.com/gravyboat)|41 <img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1396878?v=4' width='36' height='36' alt='@gravyboat'>|[@gravyboat](https://github.com/gravyboat)|41
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/10231489?v=4' width='36' height='36' alt='@myii'>|[@myii](https://github.com/myii)|40 <img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/16338056?v=4' width='36' height='36' alt='@vutny'>|[@vutny](https://github.com/vutny)|31
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/16338056?v=4' width='36' height='36' alt='@vutny'>|[@vutny](https://github.com/vutny)|30 <img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/242396?v=4' width='36' height='36' alt='@javierbertoli'>|[@javierbertoli](https://github.com/javierbertoli)|19
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/3374962?v=4' width='36' height='36' alt='@nmadhok'>|[@nmadhok](https://github.com/nmadhok)|19 <img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/3374962?v=4' width='36' height='36' alt='@nmadhok'>|[@nmadhok](https://github.com/nmadhok)|19
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/242396?v=4' width='36' height='36' alt='@javierbertoli'>|[@javierbertoli](https://github.com/javierbertoli)|18
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/528061?v=4' width='36' height='36' alt='@puneetk'>|[@puneetk](https://github.com/puneetk)|11 <img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/528061?v=4' width='36' height='36' alt='@puneetk'>|[@puneetk](https://github.com/puneetk)|11
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/745513?v=4' width='36' height='36' alt='@EvaSDK'>|[@EvaSDK](https://github.com/EvaSDK)|9 <img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/745513?v=4' width='36' height='36' alt='@EvaSDK'>|[@EvaSDK](https://github.com/EvaSDK)|9
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1713422?v=4' width='36' height='36' alt='@dferrantelli'>|[@dferrantelli](https://github.com/dferrantelli)|8 <img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1713422?v=4' width='36' height='36' alt='@dferrantelli'>|[@dferrantelli](https://github.com/dferrantelli)|8
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/5306980?v=4' width='36' height='36' alt='@johnkeates'>|[@johnkeates](https://github.com/johnkeates)|8
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/91293?v=4' width='36' height='36' alt='@whiteinge'>|[@whiteinge](https://github.com/whiteinge)|8 <img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/91293?v=4' width='36' height='36' alt='@whiteinge'>|[@whiteinge](https://github.com/whiteinge)|8
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/117961?v=4' width='36' height='36' alt='@babilen5'>|[@babilen5](https://github.com/babilen5)|8 <img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/117961?v=4' width='36' height='36' alt='@babilen5'>|[@babilen5](https://github.com/babilen5)|8
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/20441?v=4' width='36' height='36' alt='@iggy'>|[@iggy](https://github.com/iggy)|7 <img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/20441?v=4' width='36' height='36' alt='@iggy'>|[@iggy](https://github.com/iggy)|7
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13106485?v=4' width='36' height='36' alt='@dynjnelson'>|[@dynjnelson](https://github.com/dynjnelson)|7 <img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13106485?v=4' width='36' height='36' alt='@dynjnelson'>|[@dynjnelson](https://github.com/dynjnelson)|7
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/3449635?v=4' width='36' height='36' alt='@rominf'>|[@rominf](https://github.com/rominf)|7 <img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/3449635?v=4' width='36' height='36' alt='@rominf'>|[@rominf](https://github.com/rominf)|7
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/223763?v=4' width='36' height='36' alt='@alfredopalhares'>|[@alfredopalhares](https://github.com/alfredopalhares)|6 <img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/223763?v=4' width='36' height='36' alt='@alfredopalhares'>|[@alfredopalhares](https://github.com/alfredopalhares)|6
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/5306980?v=4' width='36' height='36' alt='@johnkeates'>|[@johnkeates](https://github.com/johnkeates)|6
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1920805?v=4' width='36' height='36' alt='@alxwr'>|[@alxwr](https://github.com/alxwr)|5 <img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1920805?v=4' width='36' height='36' alt='@alxwr'>|[@alxwr](https://github.com/alxwr)|5
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/74739?v=4' width='36' height='36' alt='@audreyr'>|[@audreyr](https://github.com/audreyr)|5 <img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/74739?v=4' width='36' height='36' alt='@audreyr'>|[@audreyr](https://github.com/audreyr)|5
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/278900?v=4' width='36' height='36' alt='@blast-hardcheese'>|[@blast-hardcheese](https://github.com/blast-hardcheese)|5 <img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/278900?v=4' width='36' height='36' alt='@blast-hardcheese'>|[@blast-hardcheese](https://github.com/blast-hardcheese)|5
@@ -65,8 +65,9 @@ Avatar|Contributor|Contributions
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/2097647?v=4' width='36' height='36' alt='@XRasher'>|[@XRasher](https://github.com/XRasher)|1 <img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/2097647?v=4' width='36' height='36' alt='@XRasher'>|[@XRasher](https://github.com/XRasher)|1
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/8005290?v=4' width='36' height='36' alt='@YetAnotherMinion'>|[@YetAnotherMinion](https://github.com/YetAnotherMinion)|1 <img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/8005290?v=4' width='36' height='36' alt='@YetAnotherMinion'>|[@YetAnotherMinion](https://github.com/YetAnotherMinion)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/17393048?v=4' width='36' height='36' alt='@ek9'>|[@ek9](https://github.com/ek9)|1 <img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/17393048?v=4' width='36' height='36' alt='@ek9'>|[@ek9](https://github.com/ek9)|1
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/11394644?v=4' width='36' height='36' alt='@Strade288'>|[@Strade288](https://github.com/Strade288)|1
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/52996?v=4' width='36' height='36' alt='@daks'>|[@daks](https://github.com/daks)|1 <img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/52996?v=4' width='36' height='36' alt='@daks'>|[@daks](https://github.com/daks)|1
--- ---
Auto generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2019-05-06. Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2019-10-11.

View File

@@ -1,5 +1,127 @@
# Changelog # Changelog
## [0.40.4](https://github.com/saltstack-formulas/postgres-formula/compare/v0.40.3...v0.40.4) (2019-10-11)
### Bug Fixes
* **rubocop:** add fixes using `rubocop --safe-auto-correct` ([](https://github.com/saltstack-formulas/postgres-formula/commit/37b0c43))
* **rubocop:** fix remaining errors manually ([](https://github.com/saltstack-formulas/postgres-formula/commit/b369aa9))
### Continuous Integration
* merge travis matrix, add `salt-lint` & `rubocop` to `lint` job ([](https://github.com/saltstack-formulas/postgres-formula/commit/7822200))
* **travis:** merge `rubocop` linter into main `lint` job ([](https://github.com/saltstack-formulas/postgres-formula/commit/2c82872))
## [0.40.3](https://github.com/saltstack-formulas/postgres-formula/compare/v0.40.2...v0.40.3) (2019-10-10)
### Bug Fixes
* **manage.sls:** fix `salt-lint` errors ([](https://github.com/saltstack-formulas/postgres-formula/commit/bf5b4d6))
* **python.sls:** fix `salt-lint` errors ([](https://github.com/saltstack-formulas/postgres-formula/commit/1f3cfcc))
### Continuous Integration
* **kitchen:** change `log_level` to `debug` instead of `info` ([](https://github.com/saltstack-formulas/postgres-formula/commit/7ca61f3))
* **kitchen:** install required packages to bootstrapped `opensuse` [skip ci] ([](https://github.com/saltstack-formulas/postgres-formula/commit/76e3e39))
* **kitchen:** use bootstrapped `opensuse` images until `2019.2.2` [skip ci] ([](https://github.com/saltstack-formulas/postgres-formula/commit/3a27978))
* **platform:** add `arch-base-latest` (commented out for now) [skip ci] ([](https://github.com/saltstack-formulas/postgres-formula/commit/89e4a34))
* merge travis matrix, add `salt-lint` & `rubocop` to `lint` job ([](https://github.com/saltstack-formulas/postgres-formula/commit/a0fdd48))
## [0.40.2](https://github.com/saltstack-formulas/postgres-formula/compare/v0.40.1...v0.40.2) (2019-09-13)
### Bug Fixes
* **freebsd:** no libpqdev freebsd package ([eca6d97](https://github.com/saltstack-formulas/postgres-formula/commit/eca6d97))
### Continuous Integration
* **yamllint:** add rule `empty-values` & use new `yaml-files` setting ([9796319](https://github.com/saltstack-formulas/postgres-formula/commit/9796319))
## [0.40.1](https://github.com/saltstack-formulas/postgres-formula/compare/v0.40.0...v0.40.1) (2019-09-11)
### Continuous Integration
* use `dist: bionic` & apply `opensuse-leap-15` SCP error workaround ([fc6cbe0](https://github.com/saltstack-formulas/postgres-formula/commit/fc6cbe0))
### Documentation
* **pillar.example:** update examples for freebsd ([a799214](https://github.com/saltstack-formulas/postgres-formula/commit/a799214))
# [0.40.0](https://github.com/saltstack-formulas/postgres-formula/compare/v0.39.1...v0.40.0) (2019-09-03)
### Features
* **archlinux:** add support, fixing rendering errors ([e970925](https://github.com/saltstack-formulas/postgres-formula/commit/e970925))
## [0.39.1](https://github.com/saltstack-formulas/postgres-formula/compare/v0.39.0...v0.39.1) (2019-09-01)
### Continuous Integration
* **kitchen+travis:** replace EOL pre-salted images ([140928b](https://github.com/saltstack-formulas/postgres-formula/commit/140928b))
### Tests
* **inspec:** fix reference to `suse` after gem `train` update ([677adba](https://github.com/saltstack-formulas/postgres-formula/commit/677adba))
# [0.39.0](https://github.com/saltstack-formulas/postgres-formula/compare/v0.38.0...v0.39.0) (2019-08-17)
### Features
* **yamllint:** include for this repo and apply rules throughout ([1f0fd92](https://github.com/saltstack-formulas/postgres-formula/commit/1f0fd92))
# [0.38.0](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.4...v0.38.0) (2019-07-24)
### Continuous Integration
* **kitchen:** remove `python*-pip` installation ([d999597](https://github.com/saltstack-formulas/postgres-formula/commit/d999597))
* **kitchen+travis:** modify matrix to include `develop` platform ([3f81439](https://github.com/saltstack-formulas/postgres-formula/commit/3f81439))
### Features
* **debian:** add buster support ([904ba27](https://github.com/saltstack-formulas/postgres-formula/commit/904ba27))
## [0.37.4](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.3...v0.37.4) (2019-05-31)
### Continuous Integration
* **travis:** reduce matrix down to 6 instances ([2ff919f](https://github.com/saltstack-formulas/postgres-formula/commit/2ff919f))
### Tests
* **`services_spec`:** remove temporary `suse` conditional ([81165fc](https://github.com/saltstack-formulas/postgres-formula/commit/81165fc))
* **command_spec:** use cleaner `match` string using `%r` ([a054cea](https://github.com/saltstack-formulas/postgres-formula/commit/a054cea))
* **locale:** improve test using locale `en_US.UTF-8` ([7796064](https://github.com/saltstack-formulas/postgres-formula/commit/7796064))
## [0.37.3](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.2...v0.37.3) (2019-05-16)
### Bug Fixes
* **freebsd-user:** fix FreeBSD daemon's user for PostgreSQL >= 9.6 ([8745365](https://github.com/saltstack-formulas/postgres-formula/commit/8745365)), closes [#263](https://github.com/saltstack-formulas/postgres-formula/issues/263)
## [0.37.2](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.1...v0.37.2) (2019-05-12)
### Bug Fixes
* **sysrc-svc:** workaround *BSD minion indefinitely hanging on start ([0aa8b4a](https://github.com/saltstack-formulas/postgres-formula/commit/0aa8b4a))
## [0.37.1](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.0...v0.37.1) (2019-05-06) ## [0.37.1](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.0...v0.37.1) (2019-05-06)

View File

@@ -1,7 +1,7 @@
name: postgres name: postgres
os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, Windows, MacOS os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, Windows, MacOS
os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, Windows, MacOS os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, Windows, MacOS
version: 0.37.1 version: 0.40.4
release: 1 release: 1
minimum_version: 2016.11 minimum_version: 2016.11
summary: Postgres formula summary: Postgres formula

View File

@@ -1,5 +1,7 @@
source "https://rubygems.org" # frozen_string_literal: true
source 'https://rubygems.org'
gem 'kitchen-docker', '>= 2.9' gem 'kitchen-docker', '>= 2.9'
gem 'kitchen-salt', '>= 0.6.0'
gem 'kitchen-inspec', '>= 1.1' gem 'kitchen-inspec', '>= 1.1'
gem 'kitchen-salt', '>= 0.6.0'

View File

@@ -1,26 +0,0 @@
GEM
remote: https://rubygems.org/
specs:
kitchen-salt (0.0.19)
kitchen-vagrant (0.15.0)
test-kitchen (~> 1.0)
mixlib-shellout (2.0.1)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
safe_yaml (1.0.4)
test-kitchen (1.3.1)
mixlib-shellout (>= 1.2, < 3.0)
net-scp (~> 1.1)
net-ssh (~> 2.7)
safe_yaml (~> 1.0)
thor (~> 0.18)
thor (0.19.1)
PLATFORMS
ruby
DEPENDENCIES
kitchen-salt
kitchen-vagrant
test-kitchen (> 1.2.0)

32
bin/kitchen Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'kitchen' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)
bundle_binstub = File.expand_path('bundle', __dir__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort(
'Your `bin/bundle` was not generated by Bundler, '\
'so this binstub cannot run. Replace `bin/bundle` by running '\
'`bundle binstubs bundler --force`, then run this command again.'
)
end
end
require 'rubygems'
require 'bundler/setup'
load Gem.bin_path('test-kitchen', 'kitchen')

View File

@@ -13,27 +13,27 @@ This list is sorted by the number of commits per contributor in *descending* ord
* - Avatar * - Avatar
- Contributor - Contributor
- Contributions - Contributions
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/10231489?v=4' width='36' height='36' alt='@myii'>`
- `@myii <https://github.com/myii>`_
- 72
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>`
- `@noelmcloughlin <https://github.com/noelmcloughlin>`_ - `@noelmcloughlin <https://github.com/noelmcloughlin>`_
- 57 - 62
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1800660?v=4' width='36' height='36' alt='@aboe76'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1800660?v=4' width='36' height='36' alt='@aboe76'>`
- `@aboe76 <https://github.com/aboe76>`_ - `@aboe76 <https://github.com/aboe76>`_
- 47 - 53
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1396878?v=4' width='36' height='36' alt='@gravyboat'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1396878?v=4' width='36' height='36' alt='@gravyboat'>`
- `@gravyboat <https://github.com/gravyboat>`_ - `@gravyboat <https://github.com/gravyboat>`_
- 41 - 41
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/10231489?v=4' width='36' height='36' alt='@myii'>`
- `@myii <https://github.com/myii>`_
- 40
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/16338056?v=4' width='36' height='36' alt='@vutny'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/16338056?v=4' width='36' height='36' alt='@vutny'>`
- `@vutny <https://github.com/vutny>`_ - `@vutny <https://github.com/vutny>`_
- 30 - 31
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/242396?v=4' width='36' height='36' alt='@javierbertoli'>`
- `@javierbertoli <https://github.com/javierbertoli>`_
- 19
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/3374962?v=4' width='36' height='36' alt='@nmadhok'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/3374962?v=4' width='36' height='36' alt='@nmadhok'>`
- `@nmadhok <https://github.com/nmadhok>`_ - `@nmadhok <https://github.com/nmadhok>`_
- 19 - 19
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/242396?v=4' width='36' height='36' alt='@javierbertoli'>`
- `@javierbertoli <https://github.com/javierbertoli>`_
- 18
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/528061?v=4' width='36' height='36' alt='@puneetk'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/528061?v=4' width='36' height='36' alt='@puneetk'>`
- `@puneetk <https://github.com/puneetk>`_ - `@puneetk <https://github.com/puneetk>`_
- 11 - 11
@@ -43,6 +43,9 @@ This list is sorted by the number of commits per contributor in *descending* ord
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1713422?v=4' width='36' height='36' alt='@dferrantelli'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1713422?v=4' width='36' height='36' alt='@dferrantelli'>`
- `@dferrantelli <https://github.com/dferrantelli>`_ - `@dferrantelli <https://github.com/dferrantelli>`_
- 8 - 8
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/5306980?v=4' width='36' height='36' alt='@johnkeates'>`
- `@johnkeates <https://github.com/johnkeates>`_
- 8
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/91293?v=4' width='36' height='36' alt='@whiteinge'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/91293?v=4' width='36' height='36' alt='@whiteinge'>`
- `@whiteinge <https://github.com/whiteinge>`_ - `@whiteinge <https://github.com/whiteinge>`_
- 8 - 8
@@ -61,9 +64,6 @@ This list is sorted by the number of commits per contributor in *descending* ord
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/223763?v=4' width='36' height='36' alt='@alfredopalhares'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/223763?v=4' width='36' height='36' alt='@alfredopalhares'>`
- `@alfredopalhares <https://github.com/alfredopalhares>`_ - `@alfredopalhares <https://github.com/alfredopalhares>`_
- 6 - 6
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/5306980?v=4' width='36' height='36' alt='@johnkeates'>`
- `@johnkeates <https://github.com/johnkeates>`_
- 6
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1920805?v=4' width='36' height='36' alt='@alxwr'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1920805?v=4' width='36' height='36' alt='@alxwr'>`
- `@alxwr <https://github.com/alxwr>`_ - `@alxwr <https://github.com/alxwr>`_
- 5 - 5
@@ -196,6 +196,9 @@ This list is sorted by the number of commits per contributor in *descending* ord
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/17393048?v=4' width='36' height='36' alt='@ek9'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/17393048?v=4' width='36' height='36' alt='@ek9'>`
- `@ek9 <https://github.com/ek9>`_ - `@ek9 <https://github.com/ek9>`_
- 1 - 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/11394644?v=4' width='36' height='36' alt='@Strade288'>`
- `@Strade288 <https://github.com/Strade288>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/52996?v=4' width='36' height='36' alt='@daks'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/52996?v=4' width='36' height='36' alt='@daks'>`
- `@daks <https://github.com/daks>`_ - `@daks <https://github.com/daks>`_
- 1 - 1
@@ -203,4 +206,4 @@ This list is sorted by the number of commits per contributor in *descending* ord
---- ----
Auto generated by a `forked version <https://github.com/myii/maintainer>`_ of `gaocegege/maintainer <https://github.com/gaocegege/maintainer>`_ on 2019-05-06. Auto-generated by a `forked version <https://github.com/myii/maintainer>`_ of `gaocegege/maintainer <https://github.com/gaocegege/maintainer>`_ on 2019-10-11.

View File

@@ -2,6 +2,157 @@
Changelog Changelog
========= =========
`0.40.4 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.40.3...v0.40.4>`_ (2019-10-11)
-------------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **rubocop:** add fixes using ``rubocop --safe-auto-correct`` (\ ` <https://github.com/saltstack-formulas/postgres-formula/commit/37b0c43>`_\ )
* **rubocop:** fix remaining errors manually (\ ` <https://github.com/saltstack-formulas/postgres-formula/commit/b369aa9>`_\ )
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* merge travis matrix, add ``salt-lint`` & ``rubocop`` to ``lint`` job (\ ` <https://github.com/saltstack-formulas/postgres-formula/commit/7822200>`_\ )
* **travis:** merge ``rubocop`` linter into main ``lint`` job (\ ` <https://github.com/saltstack-formulas/postgres-formula/commit/2c82872>`_\ )
`0.40.3 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.40.2...v0.40.3>`_ (2019-10-10)
-------------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **manage.sls:** fix ``salt-lint`` errors (\ ` <https://github.com/saltstack-formulas/postgres-formula/commit/bf5b4d6>`_\ )
* **python.sls:** fix ``salt-lint`` errors (\ ` <https://github.com/saltstack-formulas/postgres-formula/commit/1f3cfcc>`_\ )
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* **kitchen:** change ``log_level`` to ``debug`` instead of ``info`` (\ ` <https://github.com/saltstack-formulas/postgres-formula/commit/7ca61f3>`_\ )
* **kitchen:** install required packages to bootstrapped ``opensuse`` [skip ci] (\ ` <https://github.com/saltstack-formulas/postgres-formula/commit/76e3e39>`_\ )
* **kitchen:** use bootstrapped ``opensuse`` images until ``2019.2.2`` [skip ci] (\ ` <https://github.com/saltstack-formulas/postgres-formula/commit/3a27978>`_\ )
* **platform:** add ``arch-base-latest`` (commented out for now) [skip ci] (\ ` <https://github.com/saltstack-formulas/postgres-formula/commit/89e4a34>`_\ )
* merge travis matrix, add ``salt-lint`` & ``rubocop`` to ``lint`` job (\ ` <https://github.com/saltstack-formulas/postgres-formula/commit/a0fdd48>`_\ )
`0.40.2 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.40.1...v0.40.2>`_ (2019-09-13)
-------------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **freebsd:** no libpqdev freebsd package (\ `eca6d97 <https://github.com/saltstack-formulas/postgres-formula/commit/eca6d97>`_\ )
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* **yamllint:** add rule ``empty-values`` & use new ``yaml-files`` setting (\ `9796319 <https://github.com/saltstack-formulas/postgres-formula/commit/9796319>`_\ )
`0.40.1 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.40.0...v0.40.1>`_ (2019-09-11)
-------------------------------------------------------------------------------------------------------------
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* use ``dist: bionic`` & apply ``opensuse-leap-15`` SCP error workaround (\ `fc6cbe0 <https://github.com/saltstack-formulas/postgres-formula/commit/fc6cbe0>`_\ )
Documentation
^^^^^^^^^^^^^
* **pillar.example:** update examples for freebsd (\ `a799214 <https://github.com/saltstack-formulas/postgres-formula/commit/a799214>`_\ )
`0.40.0 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.39.1...v0.40.0>`_ (2019-09-03)
-------------------------------------------------------------------------------------------------------------
Features
^^^^^^^^
* **archlinux:** add support, fixing rendering errors (\ `e970925 <https://github.com/saltstack-formulas/postgres-formula/commit/e970925>`_\ )
`0.39.1 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.39.0...v0.39.1>`_ (2019-09-01)
-------------------------------------------------------------------------------------------------------------
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* **kitchen+travis:** replace EOL pre-salted images (\ `140928b <https://github.com/saltstack-formulas/postgres-formula/commit/140928b>`_\ )
Tests
^^^^^
* **inspec:** fix reference to ``suse`` after gem ``train`` update (\ `677adba <https://github.com/saltstack-formulas/postgres-formula/commit/677adba>`_\ )
`0.39.0 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.38.0...v0.39.0>`_ (2019-08-17)
-------------------------------------------------------------------------------------------------------------
Features
^^^^^^^^
* **yamllint:** include for this repo and apply rules throughout (\ `1f0fd92 <https://github.com/saltstack-formulas/postgres-formula/commit/1f0fd92>`_\ )
`0.38.0 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.4...v0.38.0>`_ (2019-07-24)
-------------------------------------------------------------------------------------------------------------
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* **kitchen:** remove ``python*-pip`` installation (\ `d999597 <https://github.com/saltstack-formulas/postgres-formula/commit/d999597>`_\ )
* **kitchen+travis:** modify matrix to include ``develop`` platform (\ `3f81439 <https://github.com/saltstack-formulas/postgres-formula/commit/3f81439>`_\ )
Features
^^^^^^^^
* **debian:** add buster support (\ `904ba27 <https://github.com/saltstack-formulas/postgres-formula/commit/904ba27>`_\ )
`0.37.4 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.3...v0.37.4>`_ (2019-05-31)
-------------------------------------------------------------------------------------------------------------
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* **travis:** reduce matrix down to 6 instances (\ `2ff919f <https://github.com/saltstack-formulas/postgres-formula/commit/2ff919f>`_\ )
Tests
^^^^^
* **\ ``services_spec``\ :** remove temporary ``suse`` conditional (\ `81165fc <https://github.com/saltstack-formulas/postgres-formula/commit/81165fc>`_\ )
* **command_spec:** use cleaner ``match`` string using ``%r`` (\ `a054cea <https://github.com/saltstack-formulas/postgres-formula/commit/a054cea>`_\ )
* **locale:** improve test using locale ``en_US.UTF-8`` (\ `7796064 <https://github.com/saltstack-formulas/postgres-formula/commit/7796064>`_\ )
`0.37.3 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.2...v0.37.3>`_ (2019-05-16)
-------------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **freebsd-user:** fix FreeBSD daemon's user for PostgreSQL >= 9.6 (\ `8745365 <https://github.com/saltstack-formulas/postgres-formula/commit/8745365>`_\ ), closes `#263 <https://github.com/saltstack-formulas/postgres-formula/issues/263>`_
`0.37.2 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.1...v0.37.2>`_ (2019-05-12)
-------------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **sysrc-svc:** workaround *BSD minion indefinitely hanging on start (\ `0aa8b4a <https://github.com/saltstack-formulas/postgres-formula/commit/0aa8b4a>`_\ )
`0.37.1 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.0...v0.37.1>`_ (2019-05-06) `0.37.1 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.0...v0.37.1>`_ (2019-05-06)
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------

View File

@@ -156,3 +156,4 @@ An example of that:
BREAKING CHANGE: With the removal of all of the `.sls` files under BREAKING CHANGE: With the removal of all of the `.sls` files under
`template package`, this formula no longer supports the installation of `template package`, this formula no longer supports the installation of
packages. packages.

View File

@@ -39,7 +39,7 @@ Using SaltStack is a simple and effective way to implement configuration managem
To avoid this situation we can use the `pillar mechanism <http://docs.saltstack.com/en/latest/topics/pillar/>`_, which is designed to provide controlled access to data from the minions based on some selection rules. As pillar data could be easily integrated in the `Jinja <http://docs.saltstack.com/en/latest/topics/tutorials/pillar.html>`_ templates, it is a good mechanism to store values to be used in the final rendering of state files and templates. To avoid this situation we can use the `pillar mechanism <http://docs.saltstack.com/en/latest/topics/pillar/>`_, which is designed to provide controlled access to data from the minions based on some selection rules. As pillar data could be easily integrated in the `Jinja <http://docs.saltstack.com/en/latest/topics/tutorials/pillar.html>`_ templates, it is a good mechanism to store values to be used in the final rendering of state files and templates.
There are a variety of approaches on the usage of pillar and templates as seen in the `saltstack-formulas <https://github.com/saltstack-formulas>`_' repositories. `Some <https://github.com/saltstack-formulas/nginx-formula/pull/18>`_ `developments <https://github.com/saltstack-formulas/php-formula/pull/14>`_ stress the initial purpose of pillar data into a storage for most of the possible variables for a determined system configuration. This, in my opinion, is shifting too much load from the original template files approach. Adding up some `non-trivial Jinja <https://github.com/spsoit/nginx-formula/blob/81de880fe0276dd9488ffa15bc78944c0fc2b919/nginx/ng/files/nginx.conf>`_ code as essential part of composing the state file definitely makes SaltStack state files (hence formulas) more difficult to read. The extreme of this approach is that we could end up with a new render mechanism, implemented in Jinja, storing everything needed in pillar data to compose configurations. Additionally, we are establishing a strong dependency with the Jinja renderer. There are a variety of approaches on the usage of pillar and templates as seen in the `saltstack-formulas <https://github.com/saltstack-formulas>`_' repositories. `Some <https://github.com/saltstack-formulas/nginx-formula/pull/18>`_ `developments <https://github.com/saltstack-formulas/php-formula/pull/14>`_ stress the initial purpose of pillar data into a storage for most of the possible variables for a determined system configuration. This, in my opinion, is shifting too much load from the original template files approach. Adding up some `non-trivial Jinja <https://github.com/saltstack-formulas/nginx-formula/blob/f74254c07e188bd448eaf1c5f9c802d78c4c005e/nginx/files/default/nginx.conf>`_ code as essential part of composing the state file definitely makes SaltStack state files (hence formulas) more difficult to read. The extreme of this approach is that we could end up with a new render mechanism, implemented in Jinja, storing everything needed in pillar data to compose configurations. Additionally, we are establishing a strong dependency with the Jinja renderer.
In opposition to the *put the code in file_roots and the data in pillars* approach, there is the *pillar as a store for a set of key-values* approach. A full-blown configuration file abstracted in pillar and jinja is complicated to develop, understand and maintain. I think a better and simpler approach is to keep a configuration file templated using just a basic (non-extensive but extensible) set of pillar values. In opposition to the *put the code in file_roots and the data in pillars* approach, there is the *pillar as a store for a set of key-values* approach. A full-blown configuration file abstracted in pillar and jinja is complicated to develop, understand and maintain. I think a better and simpler approach is to keep a configuration file templated using just a basic (non-extensive but extensible) set of pillar values.
@@ -325,6 +325,7 @@ We can simplify the ``conf.sls`` with the new ``files_switch`` macro to use in t
* This uses ``config.get``, searching for ``ntp:tofs:source_files:Configure NTP`` to determine the list of template files to use. * This uses ``config.get``, searching for ``ntp:tofs:source_files:Configure NTP`` to determine the list of template files to use.
* If this returns a result, the default of ``['/etc/ntp.conf.jinja']`` will be appended to it.
* If this does not yield any results, the default of ``['/etc/ntp.conf.jinja']`` will be used. * If this does not yield any results, the default of ``['/etc/ntp.conf.jinja']`` will be used.
In ``libtofs.jinja``, we define this new macro ``files_switch``. In ``libtofs.jinja``, we define this new macro ``files_switch``.
@@ -426,7 +427,6 @@ The list of ``source_files`` can be given:
tofs: tofs:
source_files: source_files:
Configure NTP: Configure NTP:
- '/etc/ntp.conf.jinja'
- '/etc/ntp.conf_alt.jinja' - '/etc/ntp.conf_alt.jinja'
Resulting in: Resulting in:
@@ -434,10 +434,85 @@ Resulting in:
.. code-block:: sls .. code-block:: sls
- source: - source:
- salt://ntp/files/theminion/etc/ntp.conf.jinja
- salt://ntp/files/theminion/etc/ntp.conf_alt.jinja - salt://ntp/files/theminion/etc/ntp.conf_alt.jinja
- salt://ntp/files/Debian/etc/ntp.conf.jinja - salt://ntp/files/theminion/etc/ntp.conf.jinja
- salt://ntp/files/Debian/etc/ntp.conf_alt.jinja - salt://ntp/files/Debian/etc/ntp.conf_alt.jinja
- salt://ntp/files/default/etc/ntp.conf.jinja - salt://ntp/files/Debian/etc/ntp.conf.jinja
- salt://ntp/files/default/etc/ntp.conf_alt.jinja - salt://ntp/files/default/etc/ntp.conf_alt.jinja
- salt://ntp/files/default/etc/ntp.conf.jinja
Note: This does *not* override the default value.
Rather, the value from the pillar/config is prepended to the default.
Using sub-directories for ``components``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If your formula is composed of several components, you may prefer to provides files under sub-directories, like in the `systemd-formula <https://github.com/saltstack-formulas/systemd-formula>`_.
.. code-block::
/srv/saltstack/systemd-formula/
systemd/
init.sls
libtofs.jinja
map.jinja
networkd/
init.sls
files/
default/
network/
99-default.link
resolved/
init.sls
files/
default/
resolved.conf
timesyncd/
init.sls
files/
Arch/
resolved.conf
Debian/
resolved.conf
default/
resolved.conf
Ubuntu/
resolved.conf
For example, the following ``formula.component.config`` SLS:
.. code-block:: sls
{%- from "formula/libtofs.jinja" import files_switch with context %}
formula configuration file:
file.managed:
- name: /etc/formula.conf
- user: root
- group: root
- mode: 644
- template: jinja
- source: {{ files_switch(['formula.conf'],
lookup='formula',
use_subpath=True
)
}}
will be rendered on a ``Debian`` minion named ``salt-formula.ci.local`` as:
.. code-block:: sls
formula configuration file:
file.managed:
- name: /etc/formula.conf
- user: root
- group: root
- mode: 644
- template: jinja
- source:
- salt://formula/component/files/salt-formula.ci.local/formula.conf
- salt://formula/component/files/Debian/formula.conf
- salt://formula/component/files/default/formula.conf
- salt://formula/files/salt-formula.ci.local/formula.conf
- salt://formula/files/Debian/formula.conf
- salt://formula/files/default/formula.conf

View File

@@ -11,7 +11,61 @@ driver:
# Make sure the platforms listed below match up with # Make sure the platforms listed below match up with
# the `env.matrix` instances defined in `.travis.yml` # the `env.matrix` instances defined in `.travis.yml`
platforms: platforms:
## SALT 2019.2 ## SALT `develop`
- name: debian-10-develop-py3
driver:
image: netmanagers/salt-develop-py3:debian-10
provision_command:
- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
- sh bootstrap-salt.sh -XdPbfrq -x python3 git develop
- name: ubuntu-1804-develop-py3
driver:
image: netmanagers/salt-develop-py3:ubuntu-18.04
provision_command:
- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
- sh bootstrap-salt.sh -XdPbfrq -x python3 git develop
- name: centos-7-develop-py3
driver:
image: netmanagers/salt-develop-py3:centos-7
provision_command:
- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
- sh bootstrap-salt.sh -XdPbfrq -x python3 git develop
- name: fedora-30-develop-py3
driver:
image: netmanagers/salt-develop-py3:fedora-30
provision_command:
- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
- sh bootstrap-salt.sh -XdPbfrq -x python3 git develop
- name: opensuse-leap-15-develop-py3
driver:
image: opensuse/leap:15
provision_command:
# yamllint disable-line rule:line-length
- zypper install -y glibc-locale net-tools net-tools-deprecated python-xml python3-pip
- systemctl enable sshd.service
run_command: /usr/lib/systemd/systemd
provisioner:
salt_bootstrap_options: -XdPfrq -x python3 git develop
salt_install: bootstrap
# Workaround to avoid intermittent failures on `opensuse-leap-15`:
# => SCP did not finish successfully (255): (Net::SCP::Error)
transport:
max_ssh_sessions: 1
- name: amazonlinux-2-develop-py2
driver:
image: netmanagers/salt-develop-py2:amazonlinux-2
provision_command:
- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
- sh bootstrap-salt.sh -XdPbfrq -x python2 git develop
- name: arch-base-latest-develop-py2
driver:
image: netmanagers/salt-develop-py2:arch-base-latest
provision_command:
- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
- sh bootstrap-salt.sh -XdPbfrq -x python2 git develop
run_command: /usr/lib/systemd/systemd
## SALT `2019.2`
- name: debian-9-2019-2-py3 - name: debian-9-2019-2-py3
driver: driver:
image: netmanagers/salt-2019.2-py3:debian-9 image: netmanagers/salt-2019.2-py3:debian-9
@@ -21,15 +75,33 @@ platforms:
- name: centos-7-2019-2-py3 - name: centos-7-2019-2-py3
driver: driver:
image: netmanagers/salt-2019.2-py3:centos-7 image: netmanagers/salt-2019.2-py3:centos-7
- name: fedora-29-2019-2-py3 - name: fedora-30-2019-2-py3
driver: driver:
image: netmanagers/salt-2019.2-py3:fedora-29 image: netmanagers/salt-2019.2-py3:fedora-30
- name: opensuse-leap-15-2019-2-py3 - name: opensuse-leap-15-2019-2-py3
driver: driver:
image: netmanagers/salt-2019.2-py3:opensuse-leap-15 image: opensuse/leap:15
provision_command:
# yamllint disable-line rule:line-length
- zypper install -y glibc-locale net-tools net-tools-deprecated python-xml python3-pip
- systemctl enable sshd.service
run_command: /usr/lib/systemd/systemd
provisioner:
salt_bootstrap_options: -XdPfrq -x python3 git 2019.2
salt_install: bootstrap
# Workaround to avoid intermittent failures on `opensuse-leap-15`:
# => SCP did not finish successfully (255): (Net::SCP::Error)
transport:
max_ssh_sessions: 1
- name: amazonlinux-2-2019-2-py2
driver:
image: netmanagers/salt-2019.2-py2:amazonlinux-2
- name: arch-base-latest-2019-2-py2
driver:
image: netmanagers/salt-2019.2-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd
## SALT 2018.3 ## SALT `2018.3`
- name: debian-9-2018-3-py2 - name: debian-9-2018-3-py2
driver: driver:
image: netmanagers/salt-2018.3-py2:debian-9 image: netmanagers/salt-2018.3-py2:debian-9
@@ -42,19 +114,30 @@ platforms:
- name: fedora-29-2018-3-py2 - name: fedora-29-2018-3-py2
driver: driver:
image: netmanagers/salt-2018.3-py2:fedora-29 image: netmanagers/salt-2018.3-py2:fedora-29
# TODO: Use this when fixed instead of `opensuse-423`
- name: opensuse-leap-15-2018-3-py2 - name: opensuse-leap-15-2018-3-py2
driver: driver:
image: netmanagers/salt-2018.3-py2:opensuse-leap-15 image: opensuse/leap:15
run_command: /usr/lib/systemd/systemd
- name: opensuse-423-2018-3-py2
driver:
image: netmanagers/salt-2018.3-py2:opensuse-423
provision_command: provision_command:
- zypper refresh && zypper install -y net-tools # yamllint disable-line rule:line-length
- zypper install -y glibc-locale net-tools net-tools-deprecated python-xml python2-pip
- systemctl enable sshd.service
run_command: /usr/lib/systemd/systemd
provisioner:
salt_bootstrap_options: -XdPfrq -x python2 git 2018.3
salt_install: bootstrap
# Workaround to avoid intermittent failures on `opensuse-leap-15`:
# => SCP did not finish successfully (255): (Net::SCP::Error)
transport:
max_ssh_sessions: 1
- name: amazonlinux-2-2018-3-py2
driver:
image: netmanagers/salt-2018.3-py2:amazonlinux-2
- name: arch-base-latest-2018-3-py2
driver:
image: netmanagers/salt-2018.3-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd
## SALT 2017.7 ## SALT `2017.7`
- name: debian-8-2017-7-py2 - name: debian-8-2017-7-py2
driver: driver:
image: netmanagers/salt-2017.7-py2:debian-8 image: netmanagers/salt-2017.7-py2:debian-8
@@ -65,25 +148,53 @@ platforms:
driver: driver:
image: netmanagers/salt-2017.7-py2:centos-6 image: netmanagers/salt-2017.7-py2:centos-6
run_command: /sbin/init run_command: /sbin/init
- name: fedora-28-2017-7-py2 - name: fedora-29-2017-7-py2
driver: driver:
image: netmanagers/salt-2017.7-py2:fedora-28 image: netmanagers/salt-2017.7-py2:fedora-29
- name: opensuse-leap-42-2017-7-py2 - name: opensuse-leap-15-2017-7-py2
driver: driver:
image: netmanagers/salt-2017.7-py2:opensuse-leap-42 image: opensuse/leap:15
provision_command: provision_command:
- zypper refresh && zypper install -y python-pip # yamllint disable-line rule:line-length
- zypper install -y glibc-locale net-tools net-tools-deprecated python-xml python2-pip
- systemctl enable sshd.service
run_command: /usr/lib/systemd/systemd
provisioner:
salt_bootstrap_options: -XdPfrq -x python2 git 2017.7
salt_install: bootstrap
# Workaround to avoid intermittent failures on `opensuse-leap-15`:
# => SCP did not finish successfully (255): (Net::SCP::Error)
transport:
max_ssh_sessions: 1
- name: amazonlinux-2-2017-7-py2
driver:
image: netmanagers/salt-2017.7-py2:amazonlinux-2
- name: arch-base-latest-2017-7-py2
driver:
image: netmanagers/salt-2017.7-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd
provisioner: provisioner:
name: salt_solo name: salt_solo
log_level: info log_level: debug
salt_install: none salt_install: none
require_chef: false require_chef: false
formula: postgres formula: postgres
salt_copy_filter: salt_copy_filter:
- .kitchen - .kitchen
- .git - .git
verifier:
# https://www.inspec.io/
name: inspec
sudo: true
# cli, documentation, html, progress, json, json-min, json-rspec, junit
reporter:
- cli
suites:
- name: default
provisioner:
state_top: state_top:
base: base:
'*': '*':
@@ -95,16 +206,6 @@ provisioner:
- postgres - postgres
pillars_from_files: pillars_from_files:
postgres.sls: test/salt/pillar/postgres.sls postgres.sls: test/salt/pillar/postgres.sls
verifier: verifier:
# https://www.inspec.io/
name: inspec
sudo: true
# cli, documentation, html, progress, json, json-min, json-rspec, junit
reporter:
- cli
inspec_tests: inspec_tests:
- path: test/integration/default - path: test/integration/default
suites:
- name: default

View File

@@ -1,18 +1,21 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# Port to use for the cluster -- can be used to provide a non-standard port # Port to use for the cluster -- can be used to provide a non-standard port
# NOTE: If already set in the minion config, that value takes priority # NOTE: If already set in the minion config, that value takes priority
postgres.port: '5432' postgres.port: '5432'
postgres: postgres:
# UPSTREAM REPO # UPSTREAM REPO
# Set True to configure upstream postgresql.org repository for YUM/APT/ZYPP # Set true to configure upstream postgresql.org repository for YUM/APT/ZYPP
use_upstream_repo: False use_upstream_repo: false
# Version to install from upstream repository (if upstream_repo: True) # Version to install from upstream repository (if upstream_repo: true)
version: '10' version: '10'
# Set True to add a file in /etc/profile.d adding the bin dir in $PATH # 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 # as packages from upstream put them somewhere like /usr/pgsql-10/bin
add_profile: False add_profile: false
# If automatic package installation fails, use `fromrepo` to specify the # If automatic package installation fails, use `fromrepo` to specify the
# upstream repo to install packages from [#133, #185] (if upstream_repo: True) # upstream repo to install packages from [#133, #185] (if upstream_repo: true)
fromrepo: 'jessie-pgdg' fromrepo: 'jessie-pgdg'
### MACOS ### MACOS
@@ -24,16 +27,21 @@ postgres:
# These pillars are typically never required. # These pillars are typically never required.
# pkg: 'postgresql' # pkg: 'postgresql'
# pkg_client: 'postgresql-client' # pkg_client: 'postgresql-client'
# service: postgresql # service:
# name: 'postgresql'
# flags: -w -s -m fast
# sysrc: true
pkgs_extra: pkgs_extra:
{%- if grains.os_family not in ('FreeBSD',) %}
- postgresql-contrib - postgresql-contrib
{%- endif %}
- postgresql-plpython - postgresql-plpython
# CLUSTER # CLUSTER
# The default `encoding` is derived from the `locale` so not recommended # The default `encoding` is derived from the `locale` so not recommended
# to provide a value for it unless necessary # to provide a value for it unless necessary
cluster: cluster:
locale: en_GB.UTF-8 locale: en_US.UTF-8
# encoding: UTF8 # encoding: UTF8
# 'Alternatives system' priority incremental. 0 disables feature. # 'Alternatives system' priority incremental. 0 disables feature.
@@ -80,19 +88,19 @@ postgres:
- ['users_as_appuser', 'jsmith', 'connuser'] - ['users_as_appuser', 'jsmith', 'connuser']
# Backup extension for configuration files, defaults to ``.bak``. # Backup extension for configuration files, defaults to ``.bak``.
# Set ``False`` to stop creation of backups when config files change. # Set ``false`` to stop creation of backups when config files change.
{%- if salt['status.time']|default(none) is callable %} {%- if salt['status.time']|default(none) is callable %}
config_backup: ".backup@{{ salt['status.time']('%y-%m-%d_%H:%M:%S') }}" config_backup: ".backup@{{ salt['status.time']('%y-%m-%d_%H:%M:%S') }}"
{%- endif %} {%- endif %}
{%- if grains['init'] == 'unknown' %} {%- if 'init' in grains and grains['init'] == 'unknown' %}
# If Salt is unable to detect init system running in the scope of state run, # If Salt is unable to detect init system running in the scope of state run,
# probably we are trying to bake a container/VM image with PostgreSQL. # probably we are trying to bake a container/VM image with PostgreSQL.
# Use ``bake_image`` setting to control how PostgreSQL will be started: if set # Use ``bake_image`` setting to control how PostgreSQL will be started: if set
# to ``True`` the raw ``pg_ctl`` will be utilized instead of packaged init # to ``true`` the raw ``pg_ctl`` will be utilized instead of packaged init
# script, job or unit run with Salt ``service`` state. # script, job or unit run with Salt ``service`` state.
bake_image: True bake_image: true
{%- endif %} {%- endif %}
@@ -128,18 +136,18 @@ postgres:
localUser: localUser:
ensure: present ensure: present
password: '98ruj923h4rf' password: '98ruj923h4rf'
createdb: False createdb: false
createroles: False createroles: false
inherit: True inherit: true
replication: False replication: false
remoteUser: remoteUser:
ensure: present ensure: present
password: '98ruj923h4rf' password: '98ruj923h4rf'
createdb: False createdb: false
createroles: False createroles: false
inherit: True inherit: true
replication: False replication: false
absentUser: absentUser:
ensure: absent ensure: absent
@@ -180,14 +188,14 @@ postgres:
# optional extensions to install in schema # optional extensions to install in schema
extensions: extensions:
# postgis: {}
uuid-ossp: uuid-ossp:
schema: uuid-ossp schema: uuid-ossp
maintenance_db: db1 maintenance_db: db1
#postgis: {}
remove: remove:
data: True data: true
multiple_releases: True multiple_releases: true
releases: ['9.6', '10',] releases: ['9.6', '10']
# vim: ft=yaml ts=2 sts=2 sw=2 et # vim: ft=yaml ts=2 sts=2 sw=2 et

View File

@@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
### Set parameters based on PostgreSQL version supplied with particular distro ### Set parameters based on PostgreSQL version supplied with particular distro
{% import_yaml "postgres/repo.yaml" as repo %} {% import_yaml "postgres/repo.yaml" as repo %}
@@ -50,16 +53,18 @@
{% endmacro %} {% endmacro %}
## Debian GNU/Linux ## Debian GNU/Linux (the second parameter refers to the postgresql package version, not the distro)
{{ debian_codename('wheezy', '9.1') }} {{ debian_codename('wheezy', '9.1') }}
{{ debian_codename('jessie', '9.4') }} {{ debian_codename('jessie', '9.4') }}
{{ debian_codename('stretch', '9.6') }} {{ debian_codename('stretch', '9.6') }}
{{ debian_codename('buster', '11') }}
# `oscodename` grain has long distro name # `oscodename` grain has long distro name
# if `lsb-release` package not installed # if `lsb-release` package not installed
{{ debian_codename('wheezy', '9.1', 'Debian GNU/Linux 7 (wheezy)') }} {{ debian_codename('wheezy', '9.1', 'Debian GNU/Linux 7 (wheezy)') }}
{{ debian_codename('jessie', '9.4', 'Debian GNU/Linux 8 (jessie)') }} {{ debian_codename('jessie', '9.4', 'Debian GNU/Linux 8 (jessie)') }}
{{ debian_codename('stretch', '9.6', 'Debian GNU/Linux 9 (stretch)') }} {{ debian_codename('stretch', '9.6', 'Debian GNU/Linux 9 (stretch)') }}
{{ debian_codename('buster', '11', 'Debian GNU/Linux 10 (buster)') }}
## Ubuntu ## Ubuntu
{{ debian_codename('trusty', '9.3') }} {{ debian_codename('trusty', '9.3') }}

View File

@@ -1,8 +1,11 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# Default lookup dictionary # Default lookup dictionary
postgres: postgres:
use_upstream_repo: True use_upstream_repo: true
add_profile: False # add bin_dir to $PATH, if installed from repos add_profile: false # add bin_dir to $PATH, if installed from repos
version: '10' version: '10'
pkg: postgresql pkg: postgresql
pkgs_extra: [] pkgs_extra: []
@@ -17,7 +20,7 @@ postgres:
group: postgres group: postgres
prepare_cluster: prepare_cluster:
run: True run: true
pgcommand: initdb -D pgcommand: initdb -D
pgtestfile: PG_VERSION pgtestfile: PG_VERSION
user: postgres user: postgres
@@ -38,6 +41,7 @@ postgres:
tmpdir: /tmp/postgrestmp tmpdir: /tmp/postgrestmp
postgresapp: postgresapp:
# See: https://github.com/PostgresApp/PostgresApp/releases/ # See: https://github.com/PostgresApp/PostgresApp/releases/
# yamllint disable-line rule:line-length
url: https://github.com/PostgresApp/PostgresApp/releases/download/v2.1.1/Postgres-2.1.1.dmg url: https://github.com/PostgresApp/PostgresApp/releases/download/v2.1.1/Postgres-2.1.1.dmg
sum: sha256=ac0656b522a58fd337931313f09509c09610c4a6078fe0b8e469e69af1e1750b sum: sha256=ac0656b522a58fd337931313f09509c09610c4a6078fe0b8e469e69af1e1750b
homebrew: homebrew:
@@ -67,9 +71,11 @@ postgres:
config_backup: '.bak' config_backup: '.bak'
service: postgresql service:
name: postgresql
sysrc: false
bake_image: False bake_image: false
fromrepo: '' fromrepo: ''
@@ -84,6 +90,6 @@ postgres:
altpriority: 0 altpriority: 0
remove: remove:
data: False data: false
multiple_releases: False multiple_releases: false
releases: ['9.2', '9.3', '9.4', '9.5', '9.6', '10',] releases: ['9.2', '9.3', '9.4', '9.5', '9.6', '10']

View File

@@ -2,7 +2,7 @@
lookup=None, lookup=None,
default_files_switch=['id', 'os_family'], default_files_switch=['id', 'os_family'],
indent_width=6, indent_width=6,
v1_path_prefix='') %} use_subpath=False) %}
{#- {#-
Returns a valid value for the "source" parameter of a "file.managed" Returns a valid value for the "source" parameter of a "file.managed"
state function. This makes easier the usage of the Template Override and state function. This makes easier the usage of the Template Override and
@@ -10,15 +10,15 @@
Params: Params:
* source_files: ordered list of files to look for * source_files: ordered list of files to look for
* lookup: key under '<tplroot>:tofs:source_files' to override * lookup: key under '<tplroot>:tofs:source_files' to prepend to the
list of source files list of source files
* default_files_switch: if there's no config (e.g. pillar) * default_files_switch: if there's no config (e.g. pillar)
'<tplroot>:tofs:files_switch' this is the ordered list of grains to '<tplroot>:tofs:files_switch' this is the ordered list of grains to
use as selector switch of the directories under use as selector switch of the directories under
"<path_prefix>/files" "<path_prefix>/files"
* indent_witdh: indentation of the result value to conform to YAML * indent_witdh: indentation of the result value to conform to YAML
* v1_path_prefix: (deprecated) only used for injecting a path prefix into * use_subpath: defaults to `False` but if set, lookup the source file
the source, to support older TOFS configs recursively from the current state directory up to `tplroot`
Example (based on a `tplroot` of `xxx`): Example (based on a `tplroot` of `xxx`):
@@ -55,20 +55,24 @@
tplroot ~ ':tofs:files_switch', tplroot ~ ':tofs:files_switch',
default_files_switch default_files_switch
) %} ) %}
{#- Lookup source_files (v2), files (v1), or fallback to source_files parameter #} {#- Lookup source_files (v2), files (v1), or fallback to an empty list #}
{%- set src_files = salt['config.get']( {%- set src_files = salt['config.get'](
tplroot ~ ':tofs:source_files:' ~ lookup, tplroot ~ ':tofs:source_files:' ~ lookup,
salt['config.get']( salt['config.get'](tplroot ~ ':tofs:files:' ~ lookup, [])
tplroot ~ ':tofs:files:' ~ lookup,
source_files
)
) %} ) %}
{#- Append the default source_files #}
{%- set src_files = src_files + source_files %}
{#- Only add to [''] when supporting older TOFS implementations #} {#- Only add to [''] when supporting older TOFS implementations #}
{%- set path_prefix_exts = [''] %} {%- set path_prefix_exts = [''] %}
{%- if v1_path_prefix != '' %} {%- if use_subpath and tplroot != tpldir %}
{%- do path_prefix_exts.append(v1_path_prefix) %} {#- Walk directory tree to find {{ files_dir }} #}
{%- set subpath_parts = tpldir.lstrip(tplroot).lstrip('/').split('/') %}
{%- for path in subpath_parts %}
{%- set subpath = subpath_parts[0:loop.index] | join('/') %}
{%- do path_prefix_exts.append('/' ~ subpath) %}
{%- endfor %}
{%- endif %} {%- endif %}
{%- for path_prefix_ext in path_prefix_exts %} {%- for path_prefix_ext in path_prefix_exts|reverse %}
{%- set path_prefix_inc_ext = path_prefix ~ path_prefix_ext %} {%- set path_prefix_inc_ext = path_prefix ~ path_prefix_ext %}
{#- For older TOFS implementation, use `files_switch` from the config #} {#- For older TOFS implementation, use `files_switch` from the config #}
{#- Use the default, new method otherwise #} {#- Use the default, new method otherwise #}
@@ -83,18 +87,26 @@
{%- for fs in fsl %} {%- for fs in fsl %}
{%- for src_file in src_files %} {%- for src_file in src_files %}
{%- if fs %} {%- if fs %}
{%- set fs_dir = salt['config.get'](fs, fs) %} {%- set fs_dirs = salt['config.get'](fs, fs) %}
{%- else %} {%- else %}
{%- set fs_dir = salt['config.get'](tplroot ~ ':tofs:dirs:default', 'default') %} {%- set fs_dirs = salt['config.get'](tplroot ~ ':tofs:dirs:default', 'default') %}
{%- endif %} {%- endif %}
{%- set url = '- salt://' ~ '/'.join([ {#- Force the `config.get` lookup result as a list where necessary #}
path_prefix_inc_ext, {#- since we need to also handle grains that are lists #}
files_dir, {%- if fs_dirs is string %}
fs_dir, {%- set fs_dirs = [fs_dirs] %}
src_file.lstrip('/') {%- endif %}
]) %} {%- for fs_dir in fs_dirs %}
{%- set url = [
'- salt:/',
path_prefix_inc_ext.strip('/'),
files_dir.strip('/'),
fs_dir.strip('/'),
src_file.strip('/'),
] | select | join('/') %}
{{ url | indent(indent_width, true) }} {{ url | indent(indent_width, true) }}
{%- endfor %} {%- endfor %}
{%- endfor %} {%- endfor %}
{%- endfor %} {%- endfor %}
{%- endfor %}
{%- endmacro %} {%- endmacro %}

View File

@@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
{% import_yaml "postgres/repo.yaml" as repo %} {% import_yaml "postgres/repo.yaml" as repo %}
{% set release = repo.version|replace('.', '') %} {% set release = repo.version|replace('.', '') %}
@@ -21,20 +24,34 @@ Debian:
{% endif %} {% endif %}
FreeBSD: FreeBSD:
conf_dir: /usr/local/pgsql/data {% if repo.version|float >= 9.6 %}
data_dir: /usr/local/pgsql/data user: &freebsd-user postgres
group: &freebsd-group postgres
conf_dir: {{ '/var/db/postgres/data' ~ release }}
data_dir: {{ '/var/db/postgres/data' ~ release }}
{% else %}
user: &freebsd-user pgsql user: &freebsd-user pgsql
group: &freebsd-group pgsql group: &freebsd-group pgsql
conf_dir: /usr/local/pgsql/data
data_dir: /usr/local/pgsql/data
{% endif %}
pkg_libpq_dev: null #not in freebsd
pkg_client: postgresql{{ release }}-client pkg_client: postgresql{{ release }}-client
pkg: postgresql{{ release }}-server pkg: postgresql{{ release }}-server
prepare_cluster: prepare_cluster:
user: *freebsd-user user: *freebsd-user
group: *freebsd-group group: *freebsd-group
service:
flags: -w -s -m fast
sysrc: True
OpenBSD: OpenBSD:
conf_dir: /var/postgresql/data conf_dir: /var/postgresql/data
data_dir: /var/postgresql/data data_dir: /var/postgresql/data
user: _postgresql user: _postgresql
service:
flags: -w -s -m fast
sysrc: True
RedHat: RedHat:
pkg_repo: pkg_repo:
@@ -54,7 +71,8 @@ RedHat:
pkg_dev: postgresql{{ release }}-devel pkg_dev: postgresql{{ release }}-devel
conf_dir: {{ data_dir }} conf_dir: {{ data_dir }}
data_dir: {{ data_dir }} data_dir: {{ data_dir }}
service: postgresql-{{ repo.version }} service:
name: postgresql-{{ repo.version }}
# Alternatives system # Alternatives system
linux: linux:
@@ -132,7 +150,8 @@ Suse:
pkg_libs: postgresql{{ release }}-libs pkg_libs: postgresql{{ release }}-libs
conf_dir: {{ data_dir }} conf_dir: {{ data_dir }}
data_dir: {{ data_dir }} data_dir: {{ data_dir }}
service: postgresql-{{ repo.version }} service:
name: postgresql-{{ repo.version }}
# Alternatives system # Alternatives system
linux: linux:
@@ -175,9 +194,11 @@ Suse:
## jinja check avoids rendering noise/failure on Linux ## jinja check avoids rendering noise/failure on Linux
MacOS: MacOS:
{%- if repo.use_upstream_repo == 'homebrew' %} {%- if repo.use_upstream_repo == 'homebrew' %}
service: homebrew.mxcl.postgresql service:
name: homebrew.mxcl.postgresql
{%- elif repo.use_upstream_repo == 'postgresapp' %} {%- elif repo.use_upstream_repo == 'postgresapp' %}
service: com.postgresapp.Postgres2 service:
name: com.postgresapp.Postgres2
{%- endif %} {%- endif %}
pkg: postgresql pkg: postgresql
pkg_client: pkg_client:

View File

@@ -1,9 +1,11 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
{% import_yaml "postgres/repo.yaml" as repo %} {% import_yaml "postgres/repo.yaml" as repo %}
Fedora: Fedora:
pkg_repo: pkg_repo:
# yamllint disable-line rule:line-length
baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/fedora/fedora-$releasever-$basearch' baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/fedora/fedora-$releasever-$basearch'
remove: remove:
releases: ['9.4', '9.5', '9.6', '10',] releases: ['9.4', '9.5', '9.6', '10']
# vim: ft=sls

View File

@@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# This file allows to get PostgreSQL version and upstream repo settings # This file allows to get PostgreSQL version and upstream repo settings
# early from Pillar to set correct lookup dictionaty items # early from Pillar to set correct lookup dictionaty items

View File

@@ -24,11 +24,11 @@ postgresql-start:
postgresql-enable: postgresql-enable:
cmd.run: cmd.run:
{%- if salt['file.file_exists']('/bin/systemctl') %} {%- if salt['file.file_exists']('/bin/systemctl') %}
- name: systemctl enable {{ postgres.service }} - name: systemctl enable {{ postgres.service.name }}
{%- elif salt['cmd.which']('chkconfig') %} {%- elif salt['cmd.which']('chkconfig') %}
- name: chkconfig {{ postgres.service }} on - name: chkconfig {{ postgres.service.name }} on
{%- elif salt['file.file_exists']('/usr/sbin/update-rc.d') %} {%- elif salt['file.file_exists']('/usr/sbin/update-rc.d') %}
- name: update-rc.d {{ service }} defaults - name: update-rc.d {{ postgres.service.name }} defaults
{%- else %} {%- else %}
# Nothing to do # Nothing to do
- name: 'true' - name: 'true'

View File

@@ -31,8 +31,8 @@ postgresql-server:
- require_in: - require_in:
- file: postgresql-server - file: postgresql-server
file.managed: file.managed:
- name: /Library/LaunchAgents/{{ postgres.service }}.plist - name: /Library/LaunchAgents/{{ postgres.service.name }}.plist
- source: /usr/local/opt/postgres/{{ postgres.service }}.plist - source: /usr/local/opt/postgres/{{ postgres.service.name }}.plist
- group: wheel - group: wheel
- require_in: - require_in:
- service: postgresql-running - service: postgresql-running
@@ -261,12 +261,23 @@ postgresql-tablespace-dir-{{ name }}-fcontext:
{%- if not postgres.bake_image %} {%- if not postgres.bake_image %}
# Workaround for FreeBSD minion undefinitely hanging on service start
# cf. https://github.com/saltstack/salt/issues/44848
{% if postgres.service.sysrc %}
posgresql-rc-flags:
sysrc.managed:
- name: {{ postgres.service.name }}_flags
- value: "{{ postgres.service.flags }} > /dev/null 2>&1"
- watch_in:
- service: postgresql-running
{% endif %}
# Start PostgreSQL server using OS init # Start PostgreSQL server using OS init
# Note: This is also the target for numerous `watch_in` requisites above, used # Note: This is also the target for numerous `watch_in` requisites above, used
# for the necessary service restart after changing the relevant configuration files # for the necessary service restart after changing the relevant configuration files
postgresql-running: postgresql-running:
service.running: service.running:
- name: {{ postgres.service }} - name: {{ postgres.service.name }}
- enable: True - enable: True
# Reload the service for changes made to `pg_ident.conf`, except for `MacOS` # Reload the service for changes made to `pg_ident.conf`, except for `MacOS`
@@ -275,7 +286,7 @@ postgresql-running:
postgresql-service-reload: postgresql-service-reload:
module.wait: module.wait:
- name: service.reload - name: service.reload
- m_name: {{ postgres.service }} - m_name: {{ postgres.service.name }}
- require: - require:
- service: postgresql-running - service: postgresql-running
{%- endif %} {%- endif %}

View File

@@ -2,7 +2,7 @@
postgresql-dead: postgresql-dead:
service.dead: service.dead:
- name: {{ postgres.service }} - name: {{ postgres.service.name }}
- enable: False - enable: False
postgresql-repo-removed: postgresql-repo-removed:

View File

@@ -39,6 +39,6 @@ postgresql-repo:
postgresql-repo: postgresql-repo:
test.show_notification: test.show_notification:
- text: | - text: |
PostgreSQL does not provide package repository for {{ grains['osfinger'] }} PostgreSQL does not provide package repository for {{ salt['grains.get']('osfinger', grains.os) }}
{%- endif %} {%- endif %}

View File

@@ -0,0 +1,50 @@
# InSpec Profile: `default`
This shows the implementation of the `default` 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 default
Summary
-------
Location: default
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 default
..
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 default --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).

View File

@@ -1,15 +1,18 @@
# Overide by OS # frozen_string_literal: true
# Overide by Platform
pg_port = '5432' pg_port = '5432'
if os[:family] == 'debian' or os[:name] == 'suse' pg_port = '5433' if (platform[:family] == 'debian') || (platform[:family] == 'suse')
pg_port = '5433'
end
control 'Postgres command' do control 'Postgres command' do
title 'should match desired lines' title 'should match desired lines'
# Can't use `%Q` here due to the `\` # Can't use `%Q` here due to the `\`
describe command(%q{su - postgres -c 'psql -p} + pg_port + %q{ -qtc "\l+ db2"'}) do describe command("su - postgres -c 'psql -p" + pg_port + %q( -qtc "\l+ db2"')) do
its(:stdout) { should match(/.*db2.*my_space/) } its(:stdout) do
# its(:stdout) { should match(/db2.*remoteUser.*UTF8.*en_US\.UTF-8.*en_US\.UTF-8.*my_space/) } should match(
/db2.*remoteUser.*UTF8.*en_US.UTF-8.*en_US.UTF-8.*my_space/
)
end
end end
end end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
control 'Postgres configuration' do control 'Postgres configuration' do
title 'should include the directory' title 'should include the directory'

View File

@@ -1,17 +1,14 @@
# Overide by OS # frozen_string_literal: true
# Overide by Platform
service_name = 'postgresql' service_name = 'postgresql'
pg_port = 5432 pg_port = 5432
if os[:name] == 'centos' and os[:release].start_with?('6') if (platform[:name] == 'centos') && platform[:release].start_with?('6')
service_name = 'postgresql-9.6' service_name = 'postgresql-9.6'
elsif os[:family] == 'debian' or os[:name] == 'suse' elsif (platform[:family] == 'debian') || (platform[:family] == 'suse')
pg_port = 5433 pg_port = 5433
end end
# Temporary `if` due to `opensuse-leap-15` bug re: `service`
if os[:name] == 'suse'
puts "[Skip `service`-based tests due to `opensuse-leap-15` detection bug (see https://github.com/inspec/train/issues/377)]"
puts "[Skip `service`-based tests due to `opensuse-leap-15` bug]"
else
control 'Postgres service' do control 'Postgres service' do
impact 0.5 impact 0.5
title 'should be running and enabled' title 'should be running and enabled'
@@ -25,4 +22,3 @@ control 'Postgres service' do
it { should be_listening } it { should be_listening }
end end
end end
end

View File

@@ -1,12 +1,18 @@
name: postgres # -*- coding: utf-8 -*-
title: Postgres Formula # vim: ft=yaml
maintainer: Your Name ---
name: default
title: postgres formula
maintainer: SaltStack Formulas
license: Apache-2.0 license: Apache-2.0
summary: Verify that the postgres formula is setup and configured correctly summary: Verify that the postgres formula is setup and configured correctly
supports: supports:
- os-name: debian - platform-name: debian
- os-name: ubuntu - platform-name: ubuntu
- os-name: centos - platform-name: centos
- os-name: fedora - platform-name: fedora
- os-name: opensuse - platform-name: opensuse
- os-name: suse - platform-name: suse
- platform-name: freebsd
- platform-name: amazon
- platform-name: arch

View File

@@ -1,7 +1,7 @@
# Port to use for the cluster -- can be used to provide a non-standard port # Port to use for the cluster -- can be used to provide a non-standard port
# NOTE: If already set in the minion config, that value takes priority # NOTE: If already set in the minion config, that value takes priority
{%- if not (grains.os_family == 'Debian' or grains.osfinger == 'Leap-15') %} {%- if grains.os_family != 'Debian' and salt['grains.get']('osfinger') != 'Leap-15' %}
postgres.port: '5432' postgres.port: '5432'
{%- else %} {%- else %}
postgres.port: '5433' postgres.port: '5433'
@@ -10,7 +10,7 @@ postgres.port: '5433'
postgres: postgres:
# UPSTREAM REPO # UPSTREAM REPO
# Set True to configure upstream postgresql.org repository for YUM/APT/ZYPP # Set True to configure upstream postgresql.org repository for YUM/APT/ZYPP
{%- if not (grains.os_family == 'Debian' or grains.osfinger == 'CentOS-6') %} {%- if grains.os_family != 'Debian' and salt['grains.get']('osfinger') != 'CentOS-6' %}
use_upstream_repo: False use_upstream_repo: False
{%- else %} {%- else %}
use_upstream_repo: True use_upstream_repo: True
@@ -42,13 +42,13 @@ postgres:
# - postgresql-contrib # - postgresql-contrib
# - postgresql-plpython # - postgresql-plpython
# # CLUSTER # CLUSTER
# # The default `encoding` is derived from the `locale` so not recommended # The default `encoding` is derived from the `locale` so not recommended
# # to provide a value for it unless necessary # to provide a value for it unless necessary
# cluster: cluster:
# locale: en_GB.UTF-8 locale: en_US.UTF-8
# # encoding: UTF8 # encoding: UTF8
#
# #'Alternatives system' priority incremental. 0 disables feature. # #'Alternatives system' priority incremental. 0 disables feature.
# linux: # linux:
# altpriority: 30 # altpriority: 30
@@ -166,22 +166,22 @@ postgres:
# databases to be created # databases to be created
databases: databases:
db1: db1:
owner: 'localUser' owner: localUser
# template: 'template0' template: template0
# lc_ctype: 'en_US.UTF-8' lc_ctype: en_US.UTF-8
# lc_collate: 'en_US.UTF-8' lc_collate: en_US.UTF-8
db2: db2:
owner: 'remoteUser' owner: remoteUser
# template: 'template0' template: template0
# lc_ctype: 'en_US.UTF-8' lc_ctype: en_US.UTF-8
# lc_collate: 'en_US.UTF-8' lc_collate: en_US.UTF-8
tablespace: 'my_space' tablespace: my_space
# set custom schema # set custom schema
schemas: schemas:
public: public:
owner: 'localUser' owner: localUser
# enable per-db extension # enable per-db extension
{%- if grains.os_family == 'Debian' and grains.osfinger != 'Debian-8' %} {%- if grains.os_family == 'Debian' and salt['grains.get']('osfinger') != 'Debian-8' %}
extensions: extensions:
uuid-ossp: uuid-ossp:
schema: 'public' schema: 'public'
@@ -194,7 +194,7 @@ postgres:
owner: localUser owner: localUser
# optional extensions to install in schema # optional extensions to install in schema
{%- if grains.os_family == 'Debian' and grains.osfinger != 'Debian-8' %} {%- if grains.os_family == 'Debian' and salt['grains.get']('osfinger') != 'Debian-8' %}
extensions: extensions:
uuid-ossp: uuid-ossp:
schema: uuid-ossp schema: uuid-ossp