2018-05-02 15:54:53 +02:00
|
|
|
{%- from tpldir + "/map.jinja" import postgres with context -%}
|
|
|
|
{%- from tpldir + "/macros.jinja" import format_kwargs with context -%}
|
2016-09-03 15:15:56 +03:00
|
|
|
|
2016-09-20 15:44:49 +03:00
|
|
|
{%- if 'pkg_repo' in postgres -%}
|
2015-04-21 15:13:42 -07:00
|
|
|
|
2018-03-08 12:30:25 +00:00
|
|
|
{%- if postgres.use_upstream_repo == true -%}
|
2016-09-20 15:44:49 +03:00
|
|
|
|
2018-10-11 02:37:51 +02:00
|
|
|
{%- if postgres.add_profile -%}
|
2018-10-10 17:49:33 +02:00
|
|
|
postgresql-profile:
|
|
|
|
file.managed:
|
|
|
|
- name: /etc/profile.d/postgres.sh
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- mode: 644
|
|
|
|
- template: jinja
|
|
|
|
- source: salt://postgres/templates/postgres.sh.j2
|
|
|
|
- defaults:
|
|
|
|
bin_dir: {{ postgres.bin_dir }}
|
|
|
|
{%- endif %}
|
2016-09-20 15:44:49 +03:00
|
|
|
# Add upstream repository for your distro
|
2016-09-26 13:57:55 +03:00
|
|
|
postgresql-repo:
|
2015-04-21 15:13:42 -07:00
|
|
|
pkgrepo.managed:
|
2016-09-20 15:44:49 +03:00
|
|
|
{{- format_kwargs(postgres.pkg_repo) }}
|
|
|
|
|
|
|
|
{%- else -%}
|
|
|
|
|
|
|
|
# Remove the repo configuration (and GnuPG key) as requested
|
2016-09-26 13:57:55 +03:00
|
|
|
postgresql-repo:
|
2016-09-20 15:44:49 +03:00
|
|
|
pkgrepo.absent:
|
|
|
|
- name: {{ postgres.pkg_repo.name }}
|
|
|
|
{%- if 'pkg_repo_keyid' in postgres %}
|
|
|
|
- keyid: {{ postgres.pkg_repo_keyid }}
|
|
|
|
{%- endif %}
|
2015-04-22 17:47:02 -05:00
|
|
|
|
2016-09-20 15:44:49 +03:00
|
|
|
{%- endif -%}
|
2016-09-03 15:15:56 +03:00
|
|
|
|
2018-03-31 21:59:31 +01:00
|
|
|
{%- elif grains.os not in ('Windows', 'MacOS',) %}
|
2016-09-20 15:44:49 +03:00
|
|
|
|
2016-09-26 13:57:55 +03:00
|
|
|
postgresql-repo:
|
2016-09-20 15:44:49 +03:00
|
|
|
test.show_notification:
|
|
|
|
- text: |
|
|
|
|
PostgreSQL does not provide package repository for {{ grains['osfinger'] }}
|
2016-09-03 15:15:56 +03:00
|
|
|
|
|
|
|
{%- endif %}
|