From e70c87c52f93e2cddc1e7b546b0ea7b9b385f368 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Wed, 12 Jun 2019 14:50:43 +0200 Subject: [PATCH] copr: frontend: better check for initialized PG --- roles/copr/frontend-cloud/tasks/psql_setup.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/roles/copr/frontend-cloud/tasks/psql_setup.yml b/roles/copr/frontend-cloud/tasks/psql_setup.yml index b5116f6218..56b8e9d1b8 100644 --- a/roles/copr/frontend-cloud/tasks/psql_setup.yml +++ b/roles/copr/frontend-cloud/tasks/psql_setup.yml @@ -4,14 +4,13 @@ - "postgresql-server" - "postgresql-contrib" - -- name: See if postgreSQL is installed - stat: path=/var/lib/pgsql/initdb.log - register: pgsql_installed +- name: See if PostgreSQL is initialized + stat: path=/var/lib/pgsql/data/PG_VERSION + register: postgres_initialized - name: init postgresql shell: "postgresql-setup initdb" - when: not pgsql_installed.stat.exists + when: not postgres_initialized.stat.exists - name: copy pg_hba.conf copy: src="pg/pg_hba.conf" dest=/var/lib/pgsql/data/pg_hba.conf owner=postgres group=postgres mode=0600