mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 09:40:26 +00:00
35 lines
891 B
Text
35 lines
891 B
Text
{%- from "postgres/map.jinja" import postgres with context -%}
|
|
{%- from "postgres/macros.jinja" import format_kwargs with context -%}
|
|
|
|
{%- if 'pkg_repo' in postgres -%}
|
|
|
|
{%- 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 -%}
|
|
|
|
{%- else -%}
|
|
|
|
# Notify that we don't manage this distro
|
|
{% if grains.os not in ('Windows', 'MacOS',) %}
|
|
postgresql-repo:
|
|
test.show_notification:
|
|
- text: |
|
|
PostgreSQL does not provide package repository for {{ grains['osfinger'] }}
|
|
{% endif %}
|
|
|
|
{%- endif %}
|