2015-04-22 17:47:02 -05:00
|
|
|
{% import_yaml "postgres/defaults.yaml" as defaults %}
|
2018-03-27 18:40:52 +01:00
|
|
|
{% import_yaml "postgres/osfamilymap.yaml" as osfamilymap %}
|
2018-03-28 12:29:45 +01:00
|
|
|
{% import_yaml "postgres/osmap.yaml" as osmap %}
|
2016-07-08 15:34:45 -05:00
|
|
|
{% import_yaml "postgres/codenamemap.yaml" as oscodenamemap %}
|
2014-12-31 16:58:41 -05:00
|
|
|
|
2016-09-05 13:49:33 +03:00
|
|
|
{% set postgres = salt['grains.filter_by'](
|
|
|
|
defaults,
|
2016-07-08 15:34:45 -05:00
|
|
|
merge=salt['grains.filter_by'](
|
2018-03-27 18:40:52 +01:00
|
|
|
osfamilymap,
|
2016-09-05 13:49:33 +03:00
|
|
|
grain='os_family',
|
2016-07-08 15:34:45 -05:00
|
|
|
merge=salt['grains.filter_by'](
|
2018-03-28 12:29:45 +01:00
|
|
|
osmap,
|
|
|
|
grain='os',
|
|
|
|
merge=salt['grains.filter_by'](
|
|
|
|
oscodenamemap,
|
|
|
|
grain='oscodename',
|
|
|
|
merge=salt['pillar.get']('postgres', {}),
|
|
|
|
),
|
2016-09-05 13:49:33 +03:00
|
|
|
),
|
|
|
|
),
|
|
|
|
base='postgres',
|
2016-07-08 15:34:45 -05:00
|
|
|
) %}
|
2018-06-24 16:18:21 +01:00
|
|
|
|
|
|
|
{# 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}) %}
|