-
Notifications
You must be signed in to change notification settings - Fork 282
/
Copy pathmap.jinja
32 lines (30 loc) · 1.15 KB
/
map.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{% import_yaml "postgres/defaults.yaml" as defaults %}
{% import_yaml "postgres/osfamilymap.yaml" as osfamilymap %}
{% import_yaml "postgres/osmap.yaml" as osmap %}
{% import_yaml "postgres/codenamemap.yaml" as oscodenamemap %}
{% set postgres = salt['grains.filter_by'](
defaults,
merge=salt['grains.filter_by'](
osfamilymap,
grain='os_family',
merge=salt['grains.filter_by'](
osmap,
grain='os',
merge=salt['grains.filter_by'](
oscodenamemap,
grain='oscodename',
merge=salt['pillar.get']('postgres', {}),
),
),
),
base='postgres',
) %}
{# Concatenate the cluster preparation command and then append it to the `postgres` dict #}
{% set pc_cmd = '{0} {1}'.format(postgres.prepare_cluster.pgcommand, postgres.data_dir) %}
{% if postgres.cluster.locale %}
{% set pc_cmd = '{0} --locale={1}'.format(pc_cmd, postgres.cluster.locale) %}
{% endif %}
{% if postgres.cluster.encoding %}
{% set pc_cmd = '{0} --encoding={1}'.format(pc_cmd, postgres.cluster.encoding) %}
{% endif %}
{% do postgres.update({'prepare_cluster_cmd': pc_cmd}) %}