mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 01:30:25 +00:00
Merge pull request #122 from vutny/debian-codenamemap
Debian: make codenamemap even if `lsb-release` pkg not installed
This commit is contained in:
commit
b972237104
1 changed files with 39 additions and 16 deletions
|
@ -1,12 +1,25 @@
|
||||||
{% macro ubuntu_block(name, version) %}
|
### Set parameters based on PostgreSQL version supplied with particular distro
|
||||||
|
|
||||||
{% if salt['pillar.get']('postgres:use_upstream_repo', False) %}
|
{% macro debian_codename(name, version, codename=none) %}
|
||||||
{% set version = salt['pillar.get']('postgres:version', '9.5') %}
|
{#
|
||||||
{% endif %}
|
Generate lookup dictionary map for Debian and derivative distributions
|
||||||
|
|
||||||
{{ name }}:
|
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 #}
|
||||||
|
{% set version = upstream_version|default(version) %}
|
||||||
|
|
||||||
|
{{ codename|default(name, true) }}:
|
||||||
|
# PostgreSQL packages are mostly downloaded from `main` repo component
|
||||||
|
pkg_repo: 'deb http://apt.postgresql.org/pub/repos/apt/ {{ name }}-pgdg main {{ version }}'
|
||||||
pkg_repo_humanname: PostgreSQL Official Repository
|
pkg_repo_humanname: PostgreSQL Official Repository
|
||||||
pkg_repo: deb http://apt.postgresql.org/pub/repos/apt/ {{ name }}-pgdg main {{ version }}
|
|
||||||
pkg: postgresql-{{ version }}
|
pkg: postgresql-{{ version }}
|
||||||
pkg_client: postgresql-client-{{ version }}
|
pkg_client: postgresql-client-{{ version }}
|
||||||
conf_dir: /etc/postgresql/{{ version }}/main
|
conf_dir: /etc/postgresql/{{ version }}/main
|
||||||
|
@ -18,16 +31,26 @@
|
||||||
|
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
# Debian GNU/Linux
|
{% if salt['pillar.get']('postgres:use_upstream_repo', false) %}
|
||||||
{{ ubuntu_block('wheezy', 9.1) }}
|
{# upstream version will always override all versions given below #}
|
||||||
{{ ubuntu_block('jessie', 9.4) }}
|
{% set upstream_version = salt['pillar.get']('postgres:version', '9.5') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# Ubuntu
|
## Debian GNU/Linux
|
||||||
{{ ubuntu_block('trusty', 9.3) }}
|
{{ debian_codename('wheezy', '9.1') }}
|
||||||
{{ ubuntu_block('precise', 9.4) }}
|
{{ debian_codename('jessie', '9.4') }}
|
||||||
{{ ubuntu_block('utopic', 9.4) }}
|
|
||||||
{{ ubuntu_block('vivid', 9.4) }}
|
# `oscodename` grain has long distro name
|
||||||
{{ ubuntu_block('wily', 9.4) }}
|
# if `lsb-release` package not installed
|
||||||
{{ ubuntu_block('xenial', 9.5) }}
|
{{ 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') }}
|
||||||
|
|
||||||
# vim: ft=sls
|
# vim: ft=sls
|
||||||
|
|
Loading…
Add table
Reference in a new issue