users.yml 879 B

1234567891011121314151617181920
  1. ---
  2. - name: Ensure PostgreSQL users are present.
  3. postgresql_user:
  4. name: "{{ item.name }}"
  5. password: "{{ item.password | default(omit) }}"
  6. login_host: "{{ item.login_host | default('localhost') }}"
  7. login_password: "{{ item.login_password | default(omit) }}"
  8. login_user: "{{ item.login_user | default(postgresql_user) }}"
  9. login_unix_socket: "{{ item.login_unix_socket | default(postgresql_unix_socket_directories[0]) }}"
  10. port: "{{ item.port | default(omit) }}"
  11. with_items: "{{ postgresql_users }}"
  12. no_log: "{{ postgres_users_no_log }}"
  13. become: true
  14. become_user: "{{ postgresql_user }}"
  15. # See: https://github.com/ansible/ansible/issues/16048#issuecomment-229012509
  16. vars:
  17. ansible_ssh_pipelining: true
  18. environment:
  19. PGOPTIONS: "{{ (postgresql_auth_method == 'scram-sha-256') | ternary('-c password_encryption=scram-sha-256', '') }}"