pdns-ansible icon indicating copy to clipboard operation
pdns-ansible copied to clipboard

add pgsql backend

Open commonism opened this issue 3 years ago • 3 comments

the changes require the postgres user to be able to connec to the database via localhost using password, peer authentication would require using become. This may require changes to pg_hba.conf and setting a postgres user password:

- name: PostgreSQL | pg_hba.conf
  community.postgresql.postgresql_pg_hba:
    dest: /etc/postgresql/13/main/pg_hba.conf
    contype: host
    users: postgres
    source: "{{item}}"
    databases: ALL
    method: md5
    create: true  
  loop: ["::1/128","127.0.0.1/32"]

- name: PostgreSQL | postgres password
  become: yes
  become_user: postgres
  community.postgresql.postgresql_user:
    user: postgres
    password: "{{ pgsql_root_password }}"
    login_unix_socket: /var/run/postgresql

commonism avatar Aug 12 '21 08:08 commonism

Sweet! If you could add some tests, I'll happily merge it :)

pieterlexis avatar Sep 06 '21 08:09 pieterlexis

when will that be merged?

lessfoobar avatar Nov 30 '21 14:11 lessfoobar

I've created a new PR that includes these changes and some tests.

https://github.com/PowerDNS/pdns-ansible/pull/211

Exchizz avatar Apr 01 '24 14:04 Exchizz