copr: frontend: better check for initialized PG

This commit is contained in:
Pavel Raiskup 2019-06-12 14:50:43 +02:00
parent abef057fa7
commit e70c87c52f

View file

@ -4,14 +4,13 @@
- "postgresql-server" - "postgresql-server"
- "postgresql-contrib" - "postgresql-contrib"
- name: See if PostgreSQL is initialized
- name: See if postgreSQL is installed stat: path=/var/lib/pgsql/data/PG_VERSION
stat: path=/var/lib/pgsql/initdb.log register: postgres_initialized
register: pgsql_installed
- name: init postgresql - name: init postgresql
shell: "postgresql-setup initdb" shell: "postgresql-setup initdb"
when: not pgsql_installed.stat.exists when: not postgres_initialized.stat.exists
- name: copy pg_hba.conf - 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 copy: src="pg/pg_hba.conf" dest=/var/lib/pgsql/data/pg_hba.conf owner=postgres group=postgres mode=0600