-
Notifications
You must be signed in to change notification settings - Fork 282
/
Copy pathcodenamemap.yaml
97 lines (80 loc) · 3.46 KB
/
codenamemap.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# -*- 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 [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 %}
{% 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)
# http://apt.postgresql.org/pub/repos/apt/dists/
# https://packages.debian.org/search?keywords=postgresql&searchon=names
{{ debian_codename('jessie', '9.4') }}
{{ debian_codename('stretch', '9.6') }}
{{ debian_codename('buster', '11') }}
{{ 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)') }}
{{ debian_codename('stretch', '9.6', 'Debian GNU/Linux 9 (stretch)') }}
{{ debian_codename('buster', '11', 'Debian GNU/Linux 10 (buster)') }}
{{ 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