Skip to content

Commit 663db90

Browse files
authored
Merge pull request #132 from vutny/workaround-salt-bug-37935
Workaround a bug in saltstack/salt#37935 for release v2016.11.0
2 parents c898531 + ab38a06 commit 663db90

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

postgres/manage.sls

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
99
include:
1010
- postgres.client
11+
{%- if 'server_bins' in postgres and grains['saltversion'] == '2016.11.0' %}
12+
# FIXME: Salt v2016.11.0 bug https://github.com/saltstack/salt/issues/37935
13+
- postgres.server
14+
{%- endif %}
1115
1216
{%- endif %}
1317

postgres/osmap.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@ RedHat:
6969
- psql
7070
- reindexdb
7171
- vacuumdb
72+
server_bins:
73+
- initdb
74+
- pg_controldata
75+
- pg_ctl
76+
- pg_resetxlog
77+
- postgres
78+
- postgresql{{ release }}-check-db-dir
79+
- postgresql{{ release }}-setup
80+
- postmaster
7281

7382
{% else %}
7483

postgres/server.sls

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,24 @@ postgresql-tablespace-dir-{{ name }}:
9292
- group
9393
9494
{%- endfor %}
95+
96+
{%- if 'bin_dir' in postgres %}
97+
98+
# Make server binaries available in $PATH
99+
100+
{%- for bin in postgres.server_bins %}
101+
102+
{%- set path = salt['file.join'](postgres.bin_dir, bin) %}
103+
104+
{{ bin }}:
105+
alternatives.install:
106+
- link: {{ salt['file.join']('/usr/bin', bin) }}
107+
- path: {{ path }}
108+
- priority: 30
109+
- onlyif: test -f {{ path }}
110+
- require:
111+
- pkg: postgresql-server
112+
113+
{%- endfor %}
114+
115+
{%- endif %}

0 commit comments

Comments
 (0)