-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure upstream repo is configured or absent depending on `use_upstre…
…am_repo`
- Loading branch information
Denys Havrysh
committed
Sep 20, 2016
1 parent
b972237
commit 855e31b
Showing
7 changed files
with
107 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
{% from "postgres/map.jinja" import postgres with context %} | ||
{%- from "postgres/map.jinja" import postgres with context -%} | ||
{%- set pkgs = [] %} | ||
{%- for pkg in (postgres.pkg_client, postgres.pkg_libpq_dev) %} | ||
{%- if pkg %} | ||
{%- do pkgs.append(pkg) %} | ||
{%- endif %} | ||
{%- endfor -%} | ||
{% if postgres.use_upstream_repo %} | ||
include: | ||
- postgres.upstream | ||
{% endif %} | ||
install-postgresql-client: | ||
pkg.installed: | ||
- name: {{ postgres.pkg_client }} | ||
- refresh: {{ postgres.use_upstream_repo }} | ||
{% if postgres.pkg_libpq_dev %} | ||
install-postgres-libpq-dev: | ||
postgresql-client: | ||
pkg.installed: | ||
- name: {{ postgres.pkg_libpq_dev }} | ||
{% endif %} | ||
- pkgs: {{ pkgs }} | ||
- refresh: {{ 'pkg_repo' in postgres }} | ||
- require: | ||
- sls: postgres.upstream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,56 @@ | ||
{%- from "postgres/map.jinja" import postgres with context %} | ||
{%- from "postgres/map.jinja" import postgres with context -%} | ||
{%- if grains['os_family'] == 'Debian' -%} | ||
{%- if not postgres.use_upstream_repo and 'pkg_repo' in postgres -%} | ||
install-postgresql-repo: | ||
postgres-repo: | ||
pkgrepo.absent: | ||
- name: {{ postgres.pkg_repo }} | ||
{%- if 'pkg_repo_keyid' in postgres %} | ||
- keyid: {{ postgres.pkg_repo_keyid }} | ||
{%- endif %} | ||
{%- if 'pkg_repo_keyfile' in postgres %} | ||
postgresql-repo-keyfile: | ||
file.absent: | ||
- name: {{ postgres.pkg_repo_keyfile }} | ||
- require: | ||
- pkgrepo: postgres-repo | ||
{%- endif %} | ||
{%- elif grains['os_family'] == 'Debian' -%} | ||
postgresql-repo: | ||
pkgrepo.managed: | ||
- humanname: {{ postgres.pkg_repo_humanname }} | ||
- name: {{ postgres.pkg_repo }} | ||
- keyid: B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 | ||
- keyserver: keyserver.ubuntu.com | ||
- humanname: {{ postgres.pkg_repo_humanname }} | ||
- key_url: {{ postgres.pkg_repo_keyurl }} | ||
- file: {{ postgres.pkg_repo_file }} | ||
- require_in: | ||
- pkg: postgresql-installed | ||
{%- elif grains['os_family'] == 'RedHat' -%} | ||
install-postgresql-repo: | ||
postgresql-repo-keyfile: | ||
file.managed: | ||
- name: /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG | ||
- source: https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG | ||
- source_hash: md5=78b5db170d33f80ad5a47863a7476b22 | ||
- name: {{ postgres.pkg_repo_keyfile }} | ||
- source: {{ postgres.pkg_repo_keyurl }} | ||
- source_hash: {{ postgres.pkg_repo_keyhash }} | ||
postgresql-repo: | ||
pkgrepo.managed: | ||
- name: {{ postgres.pkg_repo }} | ||
- humanname: {{ postgres.pkg_repo_humanname }} | ||
- baseurl: {{ postgres.pkg_repo_url }} | ||
- gpgcheck: 1 | ||
- gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG | ||
- gpgkey: 'file://{{ postgres.pkg_repo_keyfile }}' | ||
- require: | ||
- file: install-postgresql-repo | ||
- require_in: | ||
- pkg: postgresql-installed | ||
- file: postgresql-repo-keyfile | ||
{%- else -%} | ||
postgresql-repo: | ||
test.show_notification: | ||
- text: | | ||
PostgreSQL does not provide package repository for {{ grains['os_family'] }} | ||
{%- endif %} |