mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-17 10:10:31 +00:00

* 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 ```
81 lines
2.8 KiB
YAML
81 lines
2.8 KiB
YAML
# -*- coding: utf-8 -*-
|
|
# vim: ft=yaml
|
|
---
|
|
### Set parameters based on PostgreSQL version supplied with particular distro
|
|
|
|
{% import_yaml "postgres/repo.yaml" as repo %}
|
|
|
|
{# Generate lookup dictionary map for OS and derivative distributions
|
|
name: distro codename
|
|
version: PostgreSQL release version
|
|
codename: optional grain value if `name` does not match the one returned by `oscodename` grain
|
|
#}
|
|
|
|
{% macro debian_codename(name, version, codename=none) %}
|
|
|
|
{% if repo.use_upstream_repo == true %}
|
|
{% set version = repo.version %}
|
|
{% set fromrepo = repo.fromrepo|default(name ~ '-pgdg', true) %}
|
|
{% else %}
|
|
{% set fromrepo = name %}
|
|
{% endif %}
|
|
{% set cluster_name = repo.cluster_name %}
|
|
{% set conf_dir = '/etc/postgresql/{0}/{1}'.format(version, cluster_name) %}
|
|
{% set data_dir = '/var/lib/postgresql/{0}/{1}'.format(version, cluster_name) %}
|
|
|
|
{{ codename|default(name, true) }}:
|
|
# PostgreSQL packages are mostly downloaded from `main` repo component
|
|
conf_dir: {{ conf_dir }}
|
|
data_dir: {{ data_dir }}
|
|
fromrepo: {{ fromrepo }}
|
|
pkg_repo:
|
|
name: 'deb http://apt.postgresql.org/pub/repos/apt {{ name }}-pgdg main'
|
|
pkg: postgresql-{{ version }}
|
|
pkg_client: postgresql-client-{{ version }}
|
|
prepare_cluster:
|
|
pgcommand: pg_createcluster {{ version }} {{ cluster_name }} -d
|
|
user: root
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
{% macro fedora_codename(name, version, codename=none) %}
|
|
|
|
{# use upstream version if configured #}
|
|
{% if repo.use_upstream_repo == true %}
|
|
{% set version = repo.version %}
|
|
{% endif %}
|
|
|
|
{{ codename|default(name, true) }}:
|
|
# PostgreSQL packages are mostly downloaded from `main` repo component
|
|
pkg_repo:
|
|
baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ version }}/fedora/fedora-$releasever-$basearch'
|
|
|
|
{% endmacro %}
|
|
|
|
## Debian GNU/Linux (the second parameter refers to the postgresql package version, not the distro)
|
|
{{ debian_codename('wheezy', '9.1') }}
|
|
{{ debian_codename('jessie', '9.4') }}
|
|
{{ debian_codename('stretch', '9.6') }}
|
|
{{ debian_codename('buster', '11') }}
|
|
|
|
# `oscodename` grain has long distro name
|
|
# if `lsb-release` package not installed
|
|
{{ debian_codename('wheezy', '9.1', 'Debian GNU/Linux 7 (wheezy)') }}
|
|
{{ debian_codename('jessie', '9.4', 'Debian GNU/Linux 8 (jessie)') }}
|
|
{{ debian_codename('stretch', '9.6', 'Debian GNU/Linux 9 (stretch)') }}
|
|
{{ debian_codename('buster', '11', 'Debian GNU/Linux 10 (buster)') }}
|
|
|
|
## Ubuntu
|
|
{{ debian_codename('trusty', '9.3') }}
|
|
{{ debian_codename('xenial', '9.5') }}
|
|
{{ debian_codename('artful', '9.6') }}
|
|
{{ debian_codename('bionic', '10') }}
|
|
{{ debian_codename('cosmic', '10') }}
|
|
|
|
## Fedora
|
|
# `oscodename` grain has long distro name
|
|
{{ fedora_codename('Fedora-27', '9.6', 'Fedora 27 (Twenty Seven)') }}
|
|
{{ fedora_codename('Fedora-26', '9.6', 'Fedora 26 (Twenty Six)') }}
|
|
|
|
# vim: ft=sls
|