Only run postgresql-setup initdb when /var/lib/pgsql/data does not exist

This commit is contained in:
Pierre-Yves Chibon 2014-09-30 14:26:55 +02:00
parent 160d1efbb1
commit b5e20b4b23

View file

@ -22,7 +22,8 @@
- postgresql
- name: Initialize postgres if necessary
command: /usr/bin/postgresql-setup initdb creates=/var/lib/pgsql/data
command: /usr/bin/postgresql-setup initdb
when: not os.path.exists("/var/lib/pgsql/data")
notify:
- restart postgresql
tags: