Allow configuration of cluster name, locale & encoding

This commit is contained in:
Imran Iqbal
2018-06-21 08:30:08 +01:00
parent 9865664963
commit 34aae257e5
5 changed files with 25 additions and 4 deletions

View File

@@ -76,7 +76,14 @@ postgresql-cluster-prepared:
- name: {{ postgres.prepare_cluster.command }}
- unless: {{ postgres.prepare_cluster.test }}
{%- else %}
- name: {{ postgres.prepare_cluster.pgcommand }} {{ postgres.data_dir }}
{%- set cc_cmd = '{0} {1}'.format(postgres.prepare_cluster.pgcommand, postgres.data_dir) %}
{%- if postgres.cluster.locale %}
{%- set cc_cmd = '{0} --locale={1}'.format(cc_cmd, postgres.cluster.locale) %}
{%- endif %}
{%- if postgres.cluster.encoding %}
{%- set cc_cmd = '{0} --encoding={1}'.format(cc_cmd, postgres.cluster.encoding) %}
{%- endif %}
- name: {{ cc_cmd }}
- unless: test -f {{ postgres.data_dir }}/{{ postgres.prepare_cluster.pgtestfile }}
{%- endif %}
- cwd: /