2016-09-29 11:03:13 -05:00
|
|
|
---
|
|
|
|
- name: Ensure PostgreSQL users are present.
|
|
|
|
postgresql_user:
|
|
|
|
name: "{{ item.name }}"
|
2021-02-12 16:27:28 -03:00
|
|
|
password: "{{ item.password | default(omit) }}"
|
2021-03-31 19:21:40 +02:00
|
|
|
login_host: "{{ item.login_host | default('localhost') }}"
|
|
|
|
login_password: "{{ item.login_password | default(omit) }}"
|
|
|
|
login_user: "{{ item.login_user | default(postgresql_user) }}"
|
|
|
|
login_unix_socket: "{{ item.login_unix_socket | default(postgresql_unix_socket_directories[0]) }}"
|
|
|
|
port: "{{ item.port | default(omit) }}"
|
2016-09-29 11:03:13 -05:00
|
|
|
with_items: "{{ postgresql_users }}"
|
2020-03-20 10:42:52 -05:00
|
|
|
no_log: "{{ postgres_users_no_log }}"
|
2018-09-30 20:23:32 -05:00
|
|
|
become: true
|
2016-09-29 20:01:39 -05:00
|
|
|
become_user: "{{ postgresql_user }}"
|
|
|
|
# See: https://github.com/ansible/ansible/issues/16048#issuecomment-229012509
|
|
|
|
vars:
|
|
|
|
ansible_ssh_pipelining: true
|
2021-02-12 16:27:28 -03:00
|
|
|
environment:
|
|
|
|
PGOPTIONS: "{{ (postgresql_auth_method == 'scram-sha-256') | ternary('-c password_encryption=scram-sha-256', '') }}"
|