fix(postgresql): added check to detect possible errors when executing custom init script
This commit is contained in:
parent
7d6155f97e
commit
f9aa2cfed5
1 changed files with 2 additions and 0 deletions
|
@ -125,6 +125,8 @@
|
||||||
changed_when: false
|
changed_when: false
|
||||||
- name: run initialization file
|
- name: run initialization file
|
||||||
ansible.builtin.shell: "su {{ postgresql_default_user }} -c 'psql < {{ tmp_file.path }}'"
|
ansible.builtin.shell: "su {{ postgresql_default_user }} -c 'psql < {{ tmp_file.path }}'"
|
||||||
|
register: run_custom_sql_exec
|
||||||
|
failed_when: run_custom_sql_exec.rc != 0 or "ERROR" in run_custom_sql_exec.get("stderr", "")
|
||||||
- name: cleanup
|
- name: cleanup
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: '{{ tmp_file.path }}'
|
path: '{{ tmp_file.path }}'
|
||||||
|
|
Loading…
Add table
Reference in a new issue