Merge pull request #245 from gilou/optional_prepare
Make the preparation/initdb optional
This commit is contained in:
@@ -17,6 +17,7 @@ postgres:
|
|||||||
group: postgres
|
group: postgres
|
||||||
|
|
||||||
prepare_cluster:
|
prepare_cluster:
|
||||||
|
run: True
|
||||||
pgcommand: initdb -D
|
pgcommand: initdb -D
|
||||||
pgtestfile: PG_VERSION
|
pgtestfile: PG_VERSION
|
||||||
user: postgres
|
user: postgres
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ postgresql-cluster-prepared:
|
|||||||
- recurse:
|
- recurse:
|
||||||
- user
|
- user
|
||||||
- group
|
- group
|
||||||
|
{%- if postgres.prepare_cluster.run %}
|
||||||
cmd.run:
|
cmd.run:
|
||||||
{%- if postgres.prepare_cluster.command is defined %}
|
{%- if postgres.prepare_cluster.command is defined %}
|
||||||
{# support for depreciated 'prepare_cluster.command' pillar #}
|
{# support for depreciated 'prepare_cluster.command' pillar #}
|
||||||
@@ -84,6 +85,7 @@ postgresql-cluster-prepared:
|
|||||||
- file: postgresql-cluster-prepared
|
- file: postgresql-cluster-prepared
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- module: postgresql-service-restart
|
- module: postgresql-service-restart
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
postgresql-config-dir:
|
postgresql-config-dir:
|
||||||
file.directory:
|
file.directory:
|
||||||
@@ -99,7 +101,11 @@ postgresql-config-dir:
|
|||||||
- ignore_files
|
- ignore_files
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
- require:
|
- require:
|
||||||
|
{%- if postgres.prepare_cluster.run %}
|
||||||
- cmd: postgresql-cluster-prepared
|
- cmd: postgresql-cluster-prepared
|
||||||
|
{%- else %}
|
||||||
|
- file: postgresql-cluster-prepared
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
{%- set db_port = salt['config.option']('postgres.port') %}
|
{%- set db_port = salt['config.option']('postgres.port') %}
|
||||||
{%- if db_port %}
|
{%- if db_port %}
|
||||||
|
|||||||
Reference in New Issue
Block a user