vitabaks / postgresql_cluster

PostgreSQL High-Availability Cluster (based on Patroni). Automating with Ansible.
https://postgresql-cluster.org
MIT License
1.48k stars 394 forks source link

Question: In some reason I have always basic pg_hba.conf file content without users and vm ips #655

Closed garry-t closed 4 months ago

garry-t commented 4 months ago

Hi. Please elaborate cases when values from main.yml use in pg_hba.conf file. Because current pg_hba.conf has only basic information seems like it from auto generate section.

postgresql_pg_hba:
  - { type: "local", database: "all", user: "{{ patroni_superuser_username }}", address: "", method: "trust" }
  - { type: "local", database: "all", user: "{{ pgbouncer_auth_username }}", address: "", method: "trust" } # required for pgbouncer auth_user
  - { type: "local", database: "replication", user: "{{ patroni_superuser_username }}", address: "", method: "trust" }
  - { type: "local", database: "all", user: "all", address: "", method: "{{ postgresql_password_encryption_algorithm }}" }
  - { type: "host", database: "all", user: "all", address: "127.0.0.1/32", method: "{{ postgresql_password_encryption_algorithm }}" }
  - { type: "host", database: "all", user: "all", address: "::1/128", method: "{{ postgresql_password_encryption_algorithm }}" }

Also this one I confused with :

https://github.com/vitabaks/postgresql_cluster/blob/f59badf3513b3b7eac2ec4edfa11ff1ef72ac4ed/roles/patroni/templates/patroni.yml.j2#L137-L139

But what I see relevant data in pg_hba.conf.backup which seems like generated based on /template/pg_hba.conf.j2 Why pg_hba.conf with basic data and not with data from pg_hba.conf.backup ? hope my issue description will be clear for you. Thanks

garry-t commented 4 months ago

ok, I have found that actual file locates under /etc/ folder according to postgresql_conf_dir. closed