create linux users for pam auth

This commit is contained in:
Robert Kaussow 2018-10-22 22:10:06 +02:00
parent 3b42430f76
commit b3e2f11ab2
2 changed files with 8 additions and 0 deletions

View File

@ -43,6 +43,7 @@ postgres_users: []
# login_unix_socket: # defaults to 1st of postgres_socket_directories # login_unix_socket: # defaults to 1st of postgres_socket_directories
# port: # defaults to not set # port: # defaults to not set
# state: # defaults to 'present' # state: # defaults to 'present'
# pam_user: # defaults to not set
postgres_hba_entries: postgres_hba_entries:
- {type: local, database: all, user: all, auth_method: peer} - {type: local, database: all, user: all, auth_method: peer}

View File

@ -7,6 +7,13 @@
mode: 0600 mode: 0600
notify: __postgres_restart 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 - name: Setup client authentication
template: template:
src: postgresql/data/pg_hba.conf.j2 src: postgresql/data/pg_hba.conf.j2