From 1847ad88bcdd731116796aa02564e55f7248eda0 Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Fri, 20 May 2022 16:50:41 -0400 Subject: [PATCH] copr: access for lighttpd worked but other users didn't --- roles/copr/backend/tasks/resalloc.yml | 30 +++++++++++++++------------ 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/roles/copr/backend/tasks/resalloc.yml b/roles/copr/backend/tasks/resalloc.yml index 5e5fa9e452..66e0a4555e 100644 --- a/roles/copr/backend/tasks/resalloc.yml +++ b/roles/copr/backend/tasks/resalloc.yml @@ -25,20 +25,14 @@ - name: enable PostgreSQL service service: state=started enabled=yes name=postgresql -- name: Create PG user - postgresql_user: name="resalloc" - become: yes - become_user: postgres - -- name: Create db - postgresql_db: name="resalloc" encoding='UTF-8' owner=resalloc - become: yes - become_user: postgres - -- name: allow lighttpd user to conenct into the database as resalloc +- name: allow system users to conenct into the database lineinfile: path: /var/lib/pgsql/data/pg_ident.conf - line: "resalloc lighttpd resalloc" + line: "{{ item }}" + with_items: + - "all postgres postgres" + - "all resalloc resalloc" + - "all lighttpd resalloc" owner: postgres group: postgres mode: 0600 @@ -50,7 +44,17 @@ databases: all users: all method: peer - options: map=resalloc + options: map=all + +- name: Create PG user + postgresql_user: name="resalloc" + become: yes + become_user: postgres + +- name: Create db + postgresql_db: name="resalloc" encoding='UTF-8' owner=resalloc + become: yes + become_user: postgres - set_fact: provision_directory: /var/lib/resallocserver/provision