Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4c84df77e | ||
|
|
cd6eb0be16 | ||
|
|
a0fdd48ebb | ||
|
|
1f3cfccc0d | ||
|
|
bf5b4d6fd7 | ||
|
|
e546fc3476 | ||
|
|
4975410ca9 | ||
|
|
76e3e3983d | ||
|
|
3a27978204 | ||
|
|
89e4a34d3d | ||
|
|
934e8ff250 | ||
|
|
7ca61f3fbb | ||
|
|
4c1f76f2ff | ||
|
|
f99f2a0735 | ||
|
|
980ae5b42e | ||
|
|
eca6d97e59 | ||
|
|
5c21924335 | ||
|
|
81b1ed15c0 | ||
|
|
a799214c34 | ||
|
|
9796319a3f | ||
|
|
6e0245a9e7 | ||
|
|
fc6cbe0ab9 | ||
|
|
4c80c3641a | ||
|
|
3df38b1be2 | ||
|
|
e9709254c6 | ||
|
|
85a5dca346 | ||
|
|
aa96c783bb | ||
|
|
140928bfc2 | ||
|
|
677adbae16 | ||
|
|
766596e175 | ||
|
|
5160365a71 | ||
|
|
e81c633b4e | ||
|
|
19b6efbb33 | ||
|
|
1f0fd92674 | ||
|
|
115f638107 | ||
|
|
84eef0cf07 |
68
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
68
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: '[BUG] '
|
||||
labels: 'bug'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Notes:
|
||||
1. Only post _bug reports_ here.
|
||||
2. Use the appropriate template for _feature requests_.
|
||||
3. Please direct questions to the [`#formulas` channel on Slack](https://saltstackcommunity.slack.com/messages/C7LG8SV54/), which is bridged to `#saltstack-formulas` on Freenode.
|
||||
-->
|
||||
|
||||
## Your setup
|
||||
### Formula commit hash / release tag
|
||||
<!-- Please specify the formula's commit hash and/or release tag that you are using. -->
|
||||
|
||||
|
||||
|
||||
### Versions reports (master & minion)
|
||||
<!-- Provided by running `salt --versions-report`. Please also mention any differences in master/minion versions. -->
|
||||
|
||||
|
||||
|
||||
### Pillar / config used
|
||||
<!-- Provide links to the SLS files and/or relevant configs (be sure to remove sensitive info). -->
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Bug details
|
||||
### Describe the bug
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
|
||||
|
||||
### Steps to reproduce the bug
|
||||
<!-- Include debug logs if possible and relevant, e.g. using `salt-minion -l debug`. -->
|
||||
<!-- Alternatively, linking to Kitchen debug logs is useful, e.g. via. Travis CI. -->
|
||||
<!-- Most useful is providing a failing InSpec test, which can be used to verify any proposed fix. -->
|
||||
|
||||
|
||||
|
||||
### Expected behaviour
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
|
||||
|
||||
### Attempts to fix the bug
|
||||
<!-- Please mention any attempts you have made to fix the bug and what the results were. -->
|
||||
|
||||
|
||||
|
||||
### Additional context
|
||||
<!-- Add any other context about the problem here. -->
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
### Meta: How can this template be improved?
|
||||
<!-- Feel free to suggest how this template can be improved. -->
|
||||
|
||||
|
||||
42
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
42
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: '[FEATURE] '
|
||||
labels: 'enhancement'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Notes:
|
||||
1. Only post _feature requests_ here.
|
||||
2. Use the appropriate template for _bug reports_.
|
||||
3. Please direct questions to the [`#formulas` channel on Slack](https://saltstackcommunity.slack.com/messages/C7LG8SV54/), which is bridged to `#saltstack-formulas` on Freenode.
|
||||
-->
|
||||
|
||||
### Is your feature request related to a problem?
|
||||
<!-- A clear and concise description of what the problem is. -->
|
||||
|
||||
|
||||
|
||||
### Describe the solution you'd like
|
||||
<!-- A clear and concise description of what you want to happen. -->
|
||||
|
||||
|
||||
|
||||
### Describe alternatives you've considered
|
||||
<!-- Describe any alternative solutions or features you've considered. -->
|
||||
|
||||
|
||||
|
||||
### Additional context
|
||||
<!-- Add any other context about the feature request here. -->
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
### Meta: How can this template be improved?
|
||||
<!-- Feel free to suggest how this template can be improved. -->
|
||||
|
||||
|
||||
10
.rubocop.yml
Normal file
10
.rubocop.yml
Normal 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
13
.salt-lint
Normal 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
|
||||
118
.travis.yml
118
.travis.yml
@@ -1,65 +1,101 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
---
|
||||
stages:
|
||||
- test
|
||||
- commitlint
|
||||
- name: release
|
||||
if: branch = master AND type != pull_request
|
||||
|
||||
## Machine config
|
||||
dist: bionic
|
||||
sudo: required
|
||||
cache: bundler
|
||||
language: ruby
|
||||
dist: xenial
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
# Make sure the instances listed below match up with
|
||||
# the `platforms` defined in `kitchen.yml`
|
||||
env:
|
||||
matrix:
|
||||
- INSTANCE: default-debian-9-develop-py3
|
||||
# TODO: Re-enable this once the `systemd` service can be restarted reliably
|
||||
# - INSTANCE: default-ubuntu-1804-develop-py3
|
||||
# - INSTANCE: default-centos-7-develop-py3
|
||||
# - INSTANCE: default-fedora-29-develop-py3
|
||||
# - INSTANCE: default-opensuse-leap-15-develop-py3
|
||||
# - 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
|
||||
- INSTANCE: default-opensuse-leap-42-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
|
||||
## Language and cache config
|
||||
language: ruby
|
||||
cache: bundler
|
||||
|
||||
## Script to run for the test stage
|
||||
script:
|
||||
- bin/kitchen verify ${INSTANCE}
|
||||
- bin/kitchen verify "${INSTANCE}"
|
||||
|
||||
## Stages and jobs matrix
|
||||
stages:
|
||||
- test
|
||||
- name: release
|
||||
if: branch = master AND type != pull_request
|
||||
jobs:
|
||||
allow_failures:
|
||||
- env: Lint_rubocop
|
||||
fast_finish: true
|
||||
include:
|
||||
# Define the commitlint stage
|
||||
- stage: commitlint
|
||||
language: node_js
|
||||
## Define the test stage that runs the linters (and testing matrix, if applicable)
|
||||
|
||||
# Run all of the linters in a single job (except `rubocop`)
|
||||
- language: node_js
|
||||
node_js: lts/*
|
||||
env: Lint
|
||||
name: 'Lint: salt-lint, yamllint & commitlint'
|
||||
before_install: skip
|
||||
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 `commitlint`
|
||||
- npm install @commitlint/config-conventional -D
|
||||
- npm install @commitlint/travis-cli -D
|
||||
- commitlint-travis
|
||||
# Define the release stage that runs semantic-release
|
||||
# Run the `rubocop` linter in a separate job that is allowed to fail
|
||||
# Once these lint errors are fixed, this can be merged into a single job
|
||||
- language: node_js
|
||||
node_js: lts/*
|
||||
env: Lint_rubocop
|
||||
name: 'Lint: rubocop'
|
||||
before_install: skip
|
||||
script:
|
||||
# Install and run `rubocop`
|
||||
- gem install rubocop
|
||||
- rubocop -d
|
||||
|
||||
## 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
|
||||
language: node_js
|
||||
node_js: lts/*
|
||||
env: Release
|
||||
name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA'
|
||||
before_install: skip
|
||||
script:
|
||||
# Update `AUTHORS.md`
|
||||
|
||||
43
.yamllint
Normal file
43
.yamllint
Normal 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
|
||||
@@ -4,9 +4,9 @@ This list is sorted by the number of commits per contributor in _descending_ ord
|
||||
|
||||
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)|58
|
||||
<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)|50
|
||||
<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)|48
|
||||
<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)|70
|
||||
<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://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://avatars2.githubusercontent.com/u/242396?v=4' width='36' height='36' alt='@javierbertoli'>|[@javierbertoli](https://github.com/javierbertoli)|19
|
||||
@@ -70,4 +70,4 @@ Avatar|Contributor|Contributions
|
||||
|
||||
---
|
||||
|
||||
Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2019-07-24.
|
||||
Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2019-10-10.
|
||||
|
||||
67
CHANGELOG.md
67
CHANGELOG.md
@@ -1,5 +1,72 @@
|
||||
# Changelog
|
||||
|
||||
## [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)
|
||||
|
||||
|
||||
|
||||
2
FORMULA
2
FORMULA
@@ -1,7 +1,7 @@
|
||||
name: postgres
|
||||
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
|
||||
version: 0.38.0
|
||||
version: 0.40.3
|
||||
release: 1
|
||||
minimum_version: 2016.11
|
||||
summary: Postgres formula
|
||||
|
||||
7
Gemfile
7
Gemfile
@@ -1,6 +1,7 @@
|
||||
source "https://rubygems.org"
|
||||
# frozen_string_literal: true
|
||||
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'kitchen-docker', '>= 2.9'
|
||||
gem 'kitchen-salt', '>= 0.6.0'
|
||||
gem 'kitchen-inspec', '>= 1.1'
|
||||
|
||||
gem 'kitchen-salt', '>= 0.6.0'
|
||||
|
||||
21
bin/kitchen
21
bin/kitchen
@@ -8,22 +8,25 @@
|
||||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
require "pathname"
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
||||
Pathname.new(__FILE__).realpath)
|
||||
require 'pathname'
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
||||
Pathname.new(__FILE__).realpath)
|
||||
|
||||
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
||||
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.")
|
||||
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"
|
||||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
|
||||
load Gem.bin_path("test-kitchen", "kitchen")
|
||||
load Gem.bin_path('test-kitchen', 'kitchen')
|
||||
|
||||
@@ -13,15 +13,15 @@ This list is sorted by the number of commits per contributor in *descending* ord
|
||||
* - Avatar
|
||||
- Contributor
|
||||
- Contributions
|
||||
* - :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>`_
|
||||
- 58
|
||||
* - :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>`_
|
||||
- 50
|
||||
- 70
|
||||
* - :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>`_
|
||||
- 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'>`
|
||||
- `@aboe76 <https://github.com/aboe76>`_
|
||||
- 48
|
||||
- 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'>`
|
||||
- `@gravyboat <https://github.com/gravyboat>`_
|
||||
- 41
|
||||
@@ -206,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-07-24.
|
||||
Auto-generated by a `forked version <https://github.com/myii/maintainer>`_ of `gaocegege/maintainer <https://github.com/gaocegege/maintainer>`_ on 2019-10-10.
|
||||
|
||||
@@ -2,6 +2,89 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
`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)
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
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.
|
||||
|
||||
@@ -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.
|
||||
* 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.
|
||||
|
||||
In ``libtofs.jinja``, we define this new macro ``files_switch``.
|
||||
@@ -426,7 +427,6 @@ The list of ``source_files`` can be given:
|
||||
tofs:
|
||||
source_files:
|
||||
Configure NTP:
|
||||
- '/etc/ntp.conf.jinja'
|
||||
- '/etc/ntp.conf_alt.jinja'
|
||||
|
||||
Resulting in:
|
||||
@@ -434,10 +434,85 @@ Resulting in:
|
||||
.. code-block:: sls
|
||||
|
||||
- source:
|
||||
- salt://ntp/files/theminion/etc/ntp.conf.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/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.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
|
||||
|
||||
107
kitchen.yml
107
kitchen.yml
@@ -12,9 +12,9 @@ driver:
|
||||
# the `env.matrix` instances defined in `.travis.yml`
|
||||
platforms:
|
||||
## SALT `develop`
|
||||
- name: debian-9-develop-py3
|
||||
- name: debian-10-develop-py3
|
||||
driver:
|
||||
image: netmanagers/salt-develop-py3:debian-9
|
||||
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
|
||||
@@ -30,18 +30,39 @@ platforms:
|
||||
provision_command:
|
||||
- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
|
||||
- sh bootstrap-salt.sh -XdPbfrq -x python3 git develop
|
||||
- name: fedora-29-develop-py3
|
||||
- name: fedora-30-develop-py3
|
||||
driver:
|
||||
image: netmanagers/salt-develop-py3:fedora-29
|
||||
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: netmanagers/salt-develop-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 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 python3 git develop
|
||||
- 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`
|
||||
@@ -54,12 +75,30 @@ platforms:
|
||||
- name: centos-7-2019-2-py3
|
||||
driver:
|
||||
image: netmanagers/salt-2019.2-py3:centos-7
|
||||
- name: fedora-29-2019-2-py3
|
||||
- name: fedora-30-2019-2-py3
|
||||
driver:
|
||||
image: netmanagers/salt-2019.2-py3:fedora-29
|
||||
image: netmanagers/salt-2019.2-py3:fedora-30
|
||||
- name: opensuse-leap-15-2019-2-py3
|
||||
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
|
||||
|
||||
## SALT `2018.3`
|
||||
@@ -75,9 +114,27 @@ platforms:
|
||||
- name: fedora-29-2018-3-py2
|
||||
driver:
|
||||
image: netmanagers/salt-2018.3-py2:fedora-29
|
||||
- name: opensuse-leap-42-2018-3-py2
|
||||
- name: opensuse-leap-15-2018-3-py2
|
||||
driver:
|
||||
image: netmanagers/salt-2018.3-py2:opensuse-leap-42
|
||||
image: opensuse/leap:15
|
||||
provision_command:
|
||||
# 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
|
||||
|
||||
## SALT `2017.7`
|
||||
@@ -91,17 +148,35 @@ platforms:
|
||||
driver:
|
||||
image: netmanagers/salt-2017.7-py2:centos-6
|
||||
run_command: /sbin/init
|
||||
- name: fedora-28-2017-7-py2
|
||||
- name: fedora-29-2017-7-py2
|
||||
driver:
|
||||
image: netmanagers/salt-2017.7-py2:fedora-28
|
||||
- name: opensuse-leap-42-2017-7-py2
|
||||
image: netmanagers/salt-2017.7-py2:fedora-29
|
||||
- name: opensuse-leap-15-2017-7-py2
|
||||
driver:
|
||||
image: netmanagers/salt-2017.7-py2:opensuse-leap-42
|
||||
image: opensuse/leap:15
|
||||
provision_command:
|
||||
# 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
|
||||
|
||||
provisioner:
|
||||
name: salt_solo
|
||||
log_level: info
|
||||
log_level: debug
|
||||
salt_install: none
|
||||
require_chef: false
|
||||
formula: postgres
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
---
|
||||
# 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
|
||||
postgres.port: '5432'
|
||||
|
||||
postgres:
|
||||
# UPSTREAM REPO
|
||||
# Set True to configure upstream postgresql.org repository for YUM/APT/ZYPP
|
||||
use_upstream_repo: False
|
||||
# Version to install from upstream repository (if upstream_repo: True)
|
||||
# Set true to configure upstream postgresql.org repository for YUM/APT/ZYPP
|
||||
use_upstream_repo: false
|
||||
# Version to install from upstream repository (if upstream_repo: true)
|
||||
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
|
||||
add_profile: False
|
||||
add_profile: false
|
||||
# If automatic package installation fails, use `fromrepo` to specify the
|
||||
# upstream repo to install packages from [#133, #185] (if upstream_repo: True)
|
||||
# upstream repo to install packages from [#133, #185] (if upstream_repo: true)
|
||||
fromrepo: 'jessie-pgdg'
|
||||
|
||||
### MACOS
|
||||
# Set to 'postgresapp' OR 'homebrew' for MacOS
|
||||
#use_upstream_repo: 'postgresapp'
|
||||
#use_upstream_repo: 'homebrew'
|
||||
# use_upstream_repo: 'postgresapp'
|
||||
# use_upstream_repo: 'homebrew'
|
||||
|
||||
# PACKAGE
|
||||
# These pillars are typically never required.
|
||||
@@ -27,9 +30,11 @@ postgres:
|
||||
# service:
|
||||
# name: 'postgresql'
|
||||
# flags: -w -s -m fast
|
||||
# sysrc: True
|
||||
# sysrc: true
|
||||
pkgs_extra:
|
||||
{%- if grains.os_family not in ('FreeBSD',) %}
|
||||
- postgresql-contrib
|
||||
{%- endif %}
|
||||
- postgresql-plpython
|
||||
|
||||
# CLUSTER
|
||||
@@ -39,7 +44,7 @@ postgres:
|
||||
locale: en_US.UTF-8
|
||||
# encoding: UTF8
|
||||
|
||||
#'Alternatives system' priority incremental. 0 disables feature.
|
||||
# 'Alternatives system' priority incremental. 0 disables feature.
|
||||
linux:
|
||||
altpriority: 30
|
||||
|
||||
@@ -62,7 +67,7 @@ postgres:
|
||||
# are authenticated, which PostgreSQL user names they can use, which
|
||||
# databases they can access. Records take one of these forms:
|
||||
#
|
||||
#acls:
|
||||
# acls:
|
||||
# - ['local', 'DATABASE', 'USER', 'METHOD']
|
||||
# - ['host', 'DATABASE', 'USER', 'ADDRESS', 'METHOD']
|
||||
# - ['hostssl', 'DATABASE', 'USER', 'ADDRESS', 'METHOD']
|
||||
@@ -83,19 +88,19 @@ postgres:
|
||||
- ['users_as_appuser', 'jsmith', 'connuser']
|
||||
|
||||
# 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 %}
|
||||
config_backup: ".backup@{{ salt['status.time']('%y-%m-%d_%H:%M:%S') }}"
|
||||
{%- 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,
|
||||
# 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
|
||||
# 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.
|
||||
bake_image: True
|
||||
bake_image: true
|
||||
|
||||
{%- endif %}
|
||||
|
||||
@@ -106,7 +111,7 @@ postgres:
|
||||
#
|
||||
# Format is the following:
|
||||
#
|
||||
#<users|tablespaces|databases|schemas|extensions>:
|
||||
# <users|tablespaces|databases|schemas|extensions>:
|
||||
# NAME:
|
||||
# ensure: <present|absent> # 'present' is the default
|
||||
# ARGUMENT: VALUE
|
||||
@@ -117,13 +122,13 @@ postgres:
|
||||
#
|
||||
# For example, the Pillar:
|
||||
#
|
||||
#users:
|
||||
# users:
|
||||
# testUser:
|
||||
# password: test
|
||||
#
|
||||
# will render such state:
|
||||
#
|
||||
#postgres_user-testUser:
|
||||
# postgres_user-testUser:
|
||||
# postgres_user.present:
|
||||
# - name: testUser
|
||||
# - password: test
|
||||
@@ -131,18 +136,18 @@ postgres:
|
||||
localUser:
|
||||
ensure: present
|
||||
password: '98ruj923h4rf'
|
||||
createdb: False
|
||||
createroles: False
|
||||
inherit: True
|
||||
replication: False
|
||||
createdb: false
|
||||
createroles: false
|
||||
inherit: true
|
||||
replication: false
|
||||
|
||||
remoteUser:
|
||||
ensure: present
|
||||
password: '98ruj923h4rf'
|
||||
createdb: False
|
||||
createroles: False
|
||||
inherit: True
|
||||
replication: False
|
||||
createdb: false
|
||||
createroles: false
|
||||
inherit: true
|
||||
replication: false
|
||||
|
||||
absentUser:
|
||||
ensure: absent
|
||||
@@ -183,14 +188,14 @@ postgres:
|
||||
|
||||
# optional extensions to install in schema
|
||||
extensions:
|
||||
# postgis: {}
|
||||
uuid-ossp:
|
||||
schema: uuid-ossp
|
||||
maintenance_db: db1
|
||||
#postgis: {}
|
||||
|
||||
remove:
|
||||
data: True
|
||||
multiple_releases: True
|
||||
releases: ['9.6', '10',]
|
||||
data: true
|
||||
multiple_releases: true
|
||||
releases: ['9.6', '10']
|
||||
|
||||
# vim: ft=yaml ts=2 sts=2 sw=2 et
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
---
|
||||
### Set parameters based on PostgreSQL version supplied with particular distro
|
||||
|
||||
{% import_yaml "postgres/repo.yaml" as repo %}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
---
|
||||
# Default lookup dictionary
|
||||
|
||||
postgres:
|
||||
use_upstream_repo: True
|
||||
add_profile: False # add bin_dir to $PATH, if installed from repos
|
||||
use_upstream_repo: true
|
||||
add_profile: false # add bin_dir to $PATH, if installed from repos
|
||||
version: '10'
|
||||
pkg: postgresql
|
||||
pkgs_extra: []
|
||||
@@ -17,7 +20,7 @@ postgres:
|
||||
group: postgres
|
||||
|
||||
prepare_cluster:
|
||||
run: True
|
||||
run: true
|
||||
pgcommand: initdb -D
|
||||
pgtestfile: PG_VERSION
|
||||
user: postgres
|
||||
@@ -37,7 +40,8 @@ postgres:
|
||||
archive: postgres.dmg
|
||||
tmpdir: /tmp/postgrestmp
|
||||
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
|
||||
sum: sha256=ac0656b522a58fd337931313f09509c09610c4a6078fe0b8e469e69af1e1750b
|
||||
homebrew:
|
||||
@@ -68,10 +72,10 @@ postgres:
|
||||
config_backup: '.bak'
|
||||
|
||||
service:
|
||||
name: postgresql
|
||||
sysrc: False
|
||||
name: postgresql
|
||||
sysrc: false
|
||||
|
||||
bake_image: False
|
||||
bake_image: false
|
||||
|
||||
fromrepo: ''
|
||||
|
||||
@@ -82,10 +86,10 @@ postgres:
|
||||
extensions: {}
|
||||
|
||||
linux:
|
||||
#Alternatives system are disabled by a 'altpriority=0' pillar.
|
||||
# Alternatives system are disabled by a 'altpriority=0' pillar.
|
||||
altpriority: 0
|
||||
|
||||
remove:
|
||||
data: False
|
||||
multiple_releases: False
|
||||
releases: ['9.2', '9.3', '9.4', '9.5', '9.6', '10',]
|
||||
data: false
|
||||
multiple_releases: false
|
||||
releases: ['9.2', '9.3', '9.4', '9.5', '9.6', '10']
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
lookup=None,
|
||||
default_files_switch=['id', 'os_family'],
|
||||
indent_width=6,
|
||||
v1_path_prefix='') %}
|
||||
use_subpath=False) %}
|
||||
{#-
|
||||
Returns a valid value for the "source" parameter of a "file.managed"
|
||||
state function. This makes easier the usage of the Template Override and
|
||||
@@ -10,15 +10,15 @@
|
||||
|
||||
Params:
|
||||
* 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
|
||||
* default_files_switch: if there's no config (e.g. pillar)
|
||||
'<tplroot>:tofs:files_switch' this is the ordered list of grains to
|
||||
use as selector switch of the directories under
|
||||
"<path_prefix>/files"
|
||||
* indent_witdh: indentation of the result value to conform to YAML
|
||||
* v1_path_prefix: (deprecated) only used for injecting a path prefix into
|
||||
the source, to support older TOFS configs
|
||||
* use_subpath: defaults to `False` but if set, lookup the source file
|
||||
recursively from the current state directory up to `tplroot`
|
||||
|
||||
Example (based on a `tplroot` of `xxx`):
|
||||
|
||||
@@ -55,20 +55,24 @@
|
||||
tplroot ~ ':tofs: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'](
|
||||
tplroot ~ ':tofs:source_files:' ~ lookup,
|
||||
salt['config.get'](
|
||||
tplroot ~ ':tofs:files:' ~ lookup,
|
||||
source_files
|
||||
)
|
||||
salt['config.get'](tplroot ~ ':tofs:files:' ~ lookup, [])
|
||||
) %}
|
||||
{#- Append the default source_files #}
|
||||
{%- set src_files = src_files + source_files %}
|
||||
{#- Only add to [''] when supporting older TOFS implementations #}
|
||||
{%- set path_prefix_exts = [''] %}
|
||||
{%- if v1_path_prefix != '' %}
|
||||
{%- do path_prefix_exts.append(v1_path_prefix) %}
|
||||
{%- if use_subpath and tplroot != tpldir %}
|
||||
{#- 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 %}
|
||||
{%- 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 %}
|
||||
{#- For older TOFS implementation, use `files_switch` from the config #}
|
||||
{#- Use the default, new method otherwise #}
|
||||
@@ -83,18 +87,25 @@
|
||||
{%- for fs in fsl %}
|
||||
{%- for src_file in src_files %}
|
||||
{%- if fs %}
|
||||
{%- set fs_dir = salt['config.get'](fs, fs) %}
|
||||
{%- set fs_dirs = salt['config.get'](fs, fs) %}
|
||||
{%- else %}
|
||||
{%- set fs_dir = salt['config.get'](tplroot ~ ':tofs:dirs:default', 'default') %}
|
||||
{%- set fs_dirs = salt['config.get'](tplroot ~ ':tofs:dirs:default', 'default') %}
|
||||
{%- endif %}
|
||||
{%- set url = [
|
||||
'- salt:/',
|
||||
path_prefix_inc_ext.strip('/'),
|
||||
files_dir.strip('/'),
|
||||
fs_dir.strip('/'),
|
||||
src_file.strip('/'),
|
||||
] | select | join('/') %}
|
||||
{#- Force the `config.get` lookup result as a list where necessary #}
|
||||
{#- since we need to also handle grains that are lists #}
|
||||
{%- if fs_dirs is string %}
|
||||
{%- set fs_dirs = [fs_dirs] %}
|
||||
{%- 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) }}
|
||||
{%- endfor %}
|
||||
{%- endfor %}
|
||||
{%- endfor %}
|
||||
{%- endfor %}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
---
|
||||
{% import_yaml "postgres/repo.yaml" as repo %}
|
||||
|
||||
{% set release = repo.version|replace('.', '') %}
|
||||
@@ -32,6 +35,7 @@ FreeBSD:
|
||||
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: postgresql{{ release }}-server
|
||||
prepare_cluster:
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
---
|
||||
{% import_yaml "postgres/repo.yaml" as repo %}
|
||||
|
||||
Fedora:
|
||||
pkg_repo:
|
||||
# yamllint disable-line rule:line-length
|
||||
baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/fedora/fedora-$releasever-$basearch'
|
||||
remove:
|
||||
releases: ['9.4', '9.5', '9.6', '10',]
|
||||
|
||||
# vim: ft=sls
|
||||
releases: ['9.4', '9.5', '9.6', '10']
|
||||
|
||||
@@ -5,7 +5,7 @@ include:
|
||||
|
||||
postgresql-python:
|
||||
pkg.installed:
|
||||
- name: {{ postgres.pkg_python}}
|
||||
- name: {{ postgres.pkg_python }}
|
||||
{% if postgres.fromrepo %}
|
||||
- fromrepo: {{ postgres.fromrepo }}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
---
|
||||
# This file allows to get PostgreSQL version and upstream repo settings
|
||||
# early from Pillar to set correct lookup dictionaty items
|
||||
|
||||
|
||||
@@ -39,6 +39,6 @@ postgresql-repo:
|
||||
postgresql-repo:
|
||||
test.show_notification:
|
||||
- text: |
|
||||
PostgreSQL does not provide package repository for {{ grains['osfinger'] }}
|
||||
PostgreSQL does not provide package repository for {{ salt['grains.get']('osfinger', grains.os) }}
|
||||
|
||||
{%- endif %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Overide by OS
|
||||
# Overide by Platform
|
||||
pg_port = '5432'
|
||||
if os[:family] == 'debian' or os[:name] == 'suse'
|
||||
if platform[:family] == 'debian' or platform[:family] == 'suse'
|
||||
pg_port = '5433'
|
||||
end
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Overide by OS
|
||||
# Overide by Platform
|
||||
service_name = 'postgresql'
|
||||
pg_port = 5432
|
||||
if os[:name] == 'centos' and os[:release].start_with?('6')
|
||||
if platform[:name] == 'centos' and platform[:release].start_with?('6')
|
||||
service_name = 'postgresql-9.6'
|
||||
elsif os[:family] == 'debian' or os[:name] == 'suse'
|
||||
elsif platform[:family] == 'debian' or platform[:family] == 'suse'
|
||||
pg_port = 5433
|
||||
end
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
---
|
||||
name: default
|
||||
title: postgres formula
|
||||
maintainer: SaltStack Formulas
|
||||
@@ -12,3 +15,4 @@ supports:
|
||||
- platform-name: suse
|
||||
- platform-name: freebsd
|
||||
- platform-name: amazon
|
||||
- platform-name: arch
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# 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
|
||||
|
||||
{%- 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'
|
||||
{%- else %}
|
||||
postgres.port: '5433'
|
||||
@@ -10,7 +10,7 @@ postgres.port: '5433'
|
||||
postgres:
|
||||
# UPSTREAM REPO
|
||||
# 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
|
||||
{%- else %}
|
||||
use_upstream_repo: True
|
||||
@@ -181,7 +181,7 @@ postgres:
|
||||
public:
|
||||
owner: localUser
|
||||
# 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:
|
||||
uuid-ossp:
|
||||
schema: 'public'
|
||||
@@ -194,7 +194,7 @@ postgres:
|
||||
owner: localUser
|
||||
|
||||
# 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:
|
||||
uuid-ossp:
|
||||
schema: uuid-ossp
|
||||
|
||||
Reference in New Issue
Block a user