From b3e2f11ab2c52302551b854da7b6b207c4ea2092 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 22 Oct 2018 22:10:06 +0200 Subject: [PATCH] create linux users for pam auth --- defaults/main.yml | 1 + tasks/config.yml | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index cfa145b..fffaae3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -43,6 +43,7 @@ postgres_users: [] # login_unix_socket: # defaults to 1st of postgres_socket_directories # port: # defaults to not set # state: # defaults to 'present' +# pam_user: # defaults to not set postgres_hba_entries: - {type: local, database: all, user: all, auth_method: peer} diff --git a/tasks/config.yml b/tasks/config.yml index 89bbebb..9995394 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -7,6 +7,13 @@ mode: 0600 notify: __postgres_restart + - name: Create local users for pam auth + user: + name: "{{ item.name }}" + password: "{{ item.password }}" + with_items: "{{ postgres_users }}" + when: item.pam_user | default(False) + - name: Setup client authentication template: src: postgresql/data/pg_hba.conf.j2