Debian: make codenamemap even if lsb-release pkg not installed

This commit is contained in:
Denys Havrysh 2016-09-19 17:22:07 +03:00
parent 0746f6091f
commit 0bb5e69b8d

View file

@ -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