postgres-formula/postgres/upstream.sls

33 lines
825 B
Text
Raw Normal View History

{%- from tpldir + "/map.jinja" import postgres with context -%}
{%- from tpldir + "/macros.jinja" import format_kwargs with context -%}
{%- if 'pkg_repo' in postgres -%}
2018-03-08 12:30:25 +00:00
{%- if postgres.use_upstream_repo == true -%}
# Add upstream repository for your distro
postgresql-repo:
pkgrepo.managed:
{{- format_kwargs(postgres.pkg_repo) }}
{%- else -%}
# Remove the repo configuration (and GnuPG key) as requested
postgresql-repo:
pkgrepo.absent:
- name: {{ postgres.pkg_repo.name }}
{%- if 'pkg_repo_keyid' in postgres %}
- keyid: {{ postgres.pkg_repo_keyid }}
{%- endif %}
{%- endif -%}
2018-03-31 21:59:31 +01:00
{%- elif grains.os not in ('Windows', 'MacOS',) %}
postgresql-repo:
test.show_notification:
- text: |
PostgreSQL does not provide package repository for {{ grains['osfinger'] }}
{%- endif %}