retrace: do not init pg twice

This commit is contained in:
Miroslav Suchý 2020-03-05 17:00:21 +01:00 committed by Pierre-Yves Chibon
parent 54f094b2d5
commit b7ccda8f59

View file

@ -1,8 +1,6 @@
---
- name: Ensure PostgreSQL database is initialized.
command: "initdb --no-locale -D /var/lib/pgsql/data"
become: true
become_user: "postgres"
command: "postgresql-setup --initdb --unit postgresql"
args:
creates: "/var/lib/pgsql/data/PG_VERSION"
@ -76,16 +74,6 @@
state: absent
when: faf_recreate_database|bool
- name: check postgresql initdb
stat:
path: /var/lib/pgsql/initdb.log
register: st
- name: initdb postgresql
command: postgresql-setup initdb
when: st.stat.exists == False
become: true
- name: start service postgresql
service:
name: postgresql