postgres-formula/postgres/codenamemap.yaml

98 lines
3.5 KiB
YAML
Raw Normal View History

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-06 20:56:45 +01:00
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
### Set parameters based on PostgreSQL version supplied with particular distro
{% import_yaml "postgres/repo.yaml" as repo %}
2018-05-09 17:48:09 +01:00
{# 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
#}
2018-05-09 17:48:09 +01:00
{% macro debian_codename(name, version, codename=none) %}
2018-03-08 12:30:25 +00:00
{% if repo.use_upstream_repo == true %}
{% set version = repo.version %}
{% set fromrepo = repo.fromrepo|default(name ~ '-pgdg', true) %}
2018-04-09 14:59:49 +01:00
{% 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
2018-06-18 23:46:29 +01:00
conf_dir: {{ conf_dir }}
data_dir: {{ data_dir }}
2018-04-09 14:59:49 +01:00
fromrepo: {{ fromrepo }}
pkg_repo:
name: 'deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.gpg] 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
bake_image_run_cmd: pg_ctlcluster {{ version }} {{ cluster_name }} start
{% endmacro %}
2016-07-07 15:41:44 -04:00
{% macro fedora_codename(name, version, codename=none) %}
{# use upstream version if configured #}
2018-03-08 12:30:25 +00:00
{% 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 %}
2019-07-24 22:12:26 +02:00
## Debian GNU/Linux (the second parameter refers to the postgresql package version, not the distro)
# http://apt.postgresql.org/pub/repos/apt/dists/
# https://packages.debian.org/search?keywords=postgresql&searchon=names
{{ debian_codename('jessie', '9.4') }}
2017-06-20 23:40:46 +02:00
{{ debian_codename('stretch', '9.6') }}
2019-07-24 20:14:35 +02:00
{{ debian_codename('buster', '11') }}
2021-07-13 10:15:04 +12:00
{{ debian_codename('bullseye', '13') }}
{{ debian_codename('bookworm', '15') }}
# `oscodename` grain has long distro name
# if `lsb-release` package not installed
{{ debian_codename('jessie', '9.4', 'Debian GNU/Linux 8 (jessie)') }}
2017-06-20 23:40:46 +02:00
{{ debian_codename('stretch', '9.6', 'Debian GNU/Linux 9 (stretch)') }}
2019-07-24 20:14:35 +02:00
{{ debian_codename('buster', '11', 'Debian GNU/Linux 10 (buster)') }}
2021-07-13 10:15:04 +12:00
{{ debian_codename('bullseye', '13', 'Debian GNU/Linux 11 (bullseye)') }}
{{ debian_codename('bookworm', '15', 'Debian GNU/Linux 12 (bookworm)') }}
## Ubuntu
# http://apt.postgresql.org/pub/repos/apt/dists/
# https://packages.ubuntu.com/search?keywords=postgresql&searchon=names
{{ debian_codename('xenial', '9.5') }}
{{ debian_codename('bionic', '10') }}
{{ debian_codename('eoan', '11') }}
{{ debian_codename('focal', '12') }}
{{ debian_codename('jammy', '14') }}
## Fedora
# https://download.postgresql.org/pub/repos/yum/13/fedora/
# https://apps.fedoraproject.org/packages/postgresql
{{ fedora_codename('Fedora-34', '13') }}
{{ fedora_codename('Fedora-33', '13') }}
## Amazon
Amazon Linux 2:
pkgs_deps:
- libicu
- systemd-sysv
pkg_repo:
baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/redhat/rhel-7-$basearch'
# vim: ft=sls