2016-09-19 17:22:07 +03:00
|
|
|
### Set parameters based on PostgreSQL version supplied with particular distro
|
2016-09-03 15:15:56 +03:00
|
|
|
|
2016-09-23 17:50:57 +03:00
|
|
|
{% import_yaml "postgres/repo.yaml" as repo %}
|
2016-09-20 15:44:49 +03:00
|
|
|
|
2016-09-19 17:22:07 +03:00
|
|
|
{% macro debian_codename(name, version, codename=none) %}
|
|
|
|
{#
|
|
|
|
Generate lookup dictionary map for Debian and derivative distributions
|
2016-09-03 15:15:56 +03:00
|
|
|
|
2016-09-19 17:22:07 +03:00
|
|
|
name:
|
|
|
|
distro codename
|
|
|
|
version:
|
|
|
|
PostgreSQL release version
|
|
|
|
codename:
|
|
|
|
optional grain value if `name` does not match the one returned by
|
|
|
|
`oscodename` grain
|
|
|
|
#}
|
|
|
|
|
|
|
|
{# use upstream version if configured #}
|
2016-09-23 17:50:57 +03:00
|
|
|
{% if repo.use_upstream_repo %}
|
|
|
|
{% set version = repo.version %}
|
2016-09-20 15:44:49 +03:00
|
|
|
{% endif %}
|
2016-09-19 17:22:07 +03:00
|
|
|
|
|
|
|
{{ codename|default(name, true) }}:
|
|
|
|
# PostgreSQL packages are mostly downloaded from `main` repo component
|
2016-09-20 15:44:49 +03:00
|
|
|
pkg_repo:
|
2016-09-23 17:50:57 +03:00
|
|
|
name: 'deb http://apt.postgresql.org/pub/repos/apt {{ name }}-pgdg main {{ repo.version }}'
|
2016-09-03 15:15:56 +03:00
|
|
|
pkg: postgresql-{{ version }}
|
|
|
|
pkg_client: postgresql-client-{{ version }}
|
2016-07-08 16:03:55 -04:00
|
|
|
conf_dir: /etc/postgresql/{{ version }}/main
|
2016-07-08 15:34:45 -05:00
|
|
|
prepare_cluster:
|
|
|
|
command: pg_createcluster {{ version }} main
|
|
|
|
test: test -f /var/lib/postgresql/{{ version }}/main/PG_VERSION && test -f /etc/postgresql/{{ version }}/main/postgresql.conf
|
|
|
|
user: root
|
2016-09-03 15:15:56 +03:00
|
|
|
|
2016-09-05 13:49:33 +03:00
|
|
|
{% endmacro %}
|
2016-07-07 15:41:44 -04:00
|
|
|
|
2017-02-05 13:12:53 -06:00
|
|
|
|
|
|
|
{% macro fedora_codename(name, version, codename=none) %}
|
|
|
|
{#
|
|
|
|
Generate lookup dictionary map for Fedora distributions
|
|
|
|
|
|
|
|
name:
|
|
|
|
distro codename
|
|
|
|
version:
|
|
|
|
PostgreSQL release version
|
|
|
|
codename:
|
|
|
|
optional grain value if `name` does not match the one returned by
|
|
|
|
`oscodename` grain
|
|
|
|
#}
|
|
|
|
|
|
|
|
{# use upstream version if configured #}
|
|
|
|
{% if repo.use_upstream_repo %}
|
|
|
|
{% 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 %}
|
|
|
|
|
2016-09-19 17:22:07 +03:00
|
|
|
## Debian GNU/Linux
|
|
|
|
{{ debian_codename('wheezy', '9.1') }}
|
|
|
|
{{ debian_codename('jessie', '9.4') }}
|
|
|
|
|
|
|
|
# `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)') }}
|
|
|
|
|
|
|
|
## Ubuntu
|
|
|
|
{{ debian_codename('trusty', '9.3') }}
|
|
|
|
{{ debian_codename('precise', '9.4') }}
|
|
|
|
{{ debian_codename('utopic', '9.4') }}
|
|
|
|
{{ debian_codename('vivid', '9.4') }}
|
|
|
|
{{ debian_codename('wily', '9.4') }}
|
|
|
|
{{ debian_codename('xenial', '9.5') }}
|
2016-09-05 13:49:33 +03:00
|
|
|
|
2017-02-05 13:12:53 -06:00
|
|
|
## Fedora
|
|
|
|
# `oscodename` grain has long distro name
|
|
|
|
{{ fedora_codename('Fedora-25', '9.5', 'Fedora 25 (Twenty Five)') }}
|
|
|
|
{{ fedora_codename('Fedora-24', '9.5', 'Fedora 24 (Twenty Four)') }}
|
|
|
|
{{ fedora_codename('Fedora-23', '9.4', 'Fedora 23 (Twenty Three)') }}
|
|
|
|
|
2016-09-05 13:49:33 +03:00
|
|
|
# vim: ft=sls
|