diff --git a/README.md b/README.md index 73f9c5d..b761725 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Install and configure Postgresql | postgresql_config | dict | no | | add option config file | | postgresql_databases | array | no | | the database to manage | | postgresql_users | array | no | | the users to manage | +| postgresql_hba | array | no | | the hba authorizations | ### postgresql_config @@ -79,6 +80,27 @@ Example: state: present ``` +### postgresql_hba + +| Name | Type | Required | Default | Comment | +|-----------|-------|----------|---------|-------------------------------------------------------| +| type | str | yes | | connection type (host, hostssl, local) | +| databases | array | yes | | array with the database names or all string | +| users | array | yes | | array with the user names or all string | +| subnet | str | no | | allow subnet, not require if type is local | +| method | str | yes | | auth method (trust, md5, ...) | + +Example: + +``` + - type: hostssl + databases: + - myappli + users: all + subnet: samenet + method: md5 +``` + ## How to use ``` diff --git a/defaults/main.yml b/defaults/main.yml index 5ce1eac..271af20 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,6 +4,7 @@ postgresql_use_official_repository: false postgresql_primary: false postgresql_databases: [] postgresql_users: [] +postgresql_hba: [] postgresql_config: {} postgresql_config_default: data_directory: '/var/lib/postgresql/{{ postgresql_version }}/main' @@ -22,7 +23,7 @@ postgresql_config_default: min_wal_size: 80MB log_line_prefix: '%m [%p] %q%u@%d' log_timezone: Etc/UTC - cluster_name: '{{ postgresql_version }}/main' + cluster_name: '{{ postgresql_version }}/main' stats_temp_directory: '/var/run/postgresql/{{ postgresql_version }}-main.pg_stat_tmp' datestyle: iso, mdy timezone: Etc/UTC