mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-17 10:10:31 +00:00
fix(contributing): runnig formula inside container
This commit is contained in:
parent
26f3fa2f90
commit
68a791ef09
3 changed files with 10 additions and 4 deletions
|
@ -35,6 +35,7 @@
|
|||
prepare_cluster:
|
||||
pgcommand: pg_createcluster {{ version }} {{ cluster_name }} -d
|
||||
user: root
|
||||
bake_image_run_cmd: pg_ctlcluster {{ version }} {{ cluster_name }} start
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@ postgres:
|
|||
sysrc: false
|
||||
|
||||
bake_image: false
|
||||
bake_image_run_cmd: echo "do nothing by default"
|
||||
|
||||
fromrepo: ''
|
||||
|
||||
|
|
|
@ -10,15 +10,19 @@ include:
|
|||
|
||||
# An attempt to start PostgreSQL with `pg_ctl`
|
||||
|
||||
postgresql-start:
|
||||
postgresql-running:
|
||||
cmd.run:
|
||||
- name: pg_ctl -D {{ postgres.data_dir }} -l logfile start
|
||||
- name: {{ postgres.bake_image_run_cmd }}
|
||||
- runas: {{ postgres.user }}
|
||||
- unless:
|
||||
- ps -p $(head -n 1 {{ postgres.data_dir }}/postmaster.pid) 2>/dev/null
|
||||
- require:
|
||||
- file: postgresql-pg_hba
|
||||
|
||||
postgresql-service-reload:
|
||||
test.show_notification:
|
||||
- text: Imitating reload while baking an image
|
||||
|
||||
# Try to enable PostgreSQL in "manual" way
|
||||
|
||||
postgresql-enable:
|
||||
|
@ -34,11 +38,11 @@ postgresql-enable:
|
|||
- name: 'true'
|
||||
{%- endif %}
|
||||
- require:
|
||||
- cmd: postgresql-start
|
||||
- cmd: postgresql-running
|
||||
|
||||
{%- else %}
|
||||
|
||||
postgresql-start:
|
||||
postgresql-running:
|
||||
test.show_notification:
|
||||
- text: The 'postgres:bake_image' Pillar is disabled (set to 'False').
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue