pg_hba.conf
===========

Postgresドキュメントでは、
 `pg_hba.conf <https://www.postgresql.org/docs/current/auth-pg-hba-conf.html>`_ で使用可能なさまざまなオプションについて説明しています。

デフォルトでは、TPAはクラスター用に適切な\ ``pg_hba.conf``
を生成し、インスタンス間のレプリケーション、および認証されたクライアントからの接続を許可します。

``postgres_hba_settings``
のリストを提供することにより、デフォルト構成にエントリを追加できます。

.. code:: yaml

   cluster_vars:
     postgres_hba_settings:
     - "# let authenticated users connect from anywhere"
     - hostssl all all 0.0.0.0/0 scram-sha-256

``postgres_hba_local_auth_method: md5``
を設定することにより、pg_hba.confのデフォルトの\ ``local all all peer``
行をオーバーライドできます。

デフォルトのエントリが不要な場合は、\ ``postgres_hba_template``
を変更できます。

.. code:: yaml

   cluster_vars:
     postgres_hba_template: pg_hba.lines.j2
     postgres_hba_settings:
     - "# my lines of text"
     - "# and nothing but my lines"
     - "# …not even any clients!"
     - hostssl all all 0.0.0.0/0 reject

クラスターディレクトリに\ ``templates/my_hba.j2``
を作成し、次のように設定することもできます。

.. code:: yaml

   cluster_vars:
     postgres_hba_template: my_hba.j2

既存の\ ``pg_hba.conf`` だけを残したい場合は、それもできます。

.. code:: yaml

   cluster_vars:
     postgres_hba_template: 
