- name: Grant users joe and simon access to databases sales and logistics from ipv6 localhost ::1/128 using peer authentication community.postgresql.postgresql_pg_hba: dest: /var/lib/pgsql/{{postgres_version}}/data/pg_hba.conf contype: "{{ item.contype }}" users: "{{ item.users }}" source: "{{ item.source }}" databases: "{{ item.databases }}" method: "{{ item.method }}" create: true loop: "{{pg_hba_user_options}}" notify: - reloaded postgreql