From 3f63d00c87480a1e4b2b3ca0bbf62d7de6212b2b Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Sun, 18 Oct 2020 20:15:02 +0200 Subject: [PATCH] Fix some booleans. --- tasks/configure-access.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tasks/configure-access.yml b/tasks/configure-access.yml index 90438ab..7dad6f9 100644 --- a/tasks/configure-access.yml +++ b/tasks/configure-access.yml @@ -7,10 +7,10 @@ - '{{ psql_db_data | default([]) }}' - allowed_hosts when: - - psql_listen_on_ext_int | bool + - psql_listen_on_ext_int - psql_db_data is defined - item.1 is defined - - not psql_force_ssl_client_connection | bool + - not psql_force_ssl_client_connection notify: Reload postgresql tags: [ 'postgresql', 'postgres', 'pg_hba', 'pg_db' ] @@ -20,10 +20,10 @@ - '{{ psql_db_data | default([]) }}' - allowed_hosts when: - - psql_listen_on_ext_int | bool + - psql_listen_on_ext_int - psql_db_data is defined - item.1 is defined - - psql_force_ssl_client_connection | bool + - psql_force_ssl_client_connection notify: Reload postgresql tags: [ 'postgresql', 'postgres', 'pg_hba', 'pg_db' ] @@ -42,14 +42,14 @@ action: configfile path={{ psql_conf_dir }}/postgresql.conf key=listen_addresses value="'*'" register: restart_postgresql when: - - psql_listen_on_ext_int | bool + - psql_listen_on_ext_int tags: [ 'postgresql', 'postgres', 'pg_conf' ] - name: If postgresql is only accessed from localhost make it listen only on the localhost interface action: configfile path={{ psql_conf_dir }}/postgresql.conf key=listen_addresses value="'localhost'" register: restart_postgresql when: - - not psql_listen_on_ext_int | bool + - not psql_listen_on_ext_int tags: [ 'postgresql', 'postgres', 'pg_conf' ] - name: Log the connections @@ -68,7 +68,7 @@ action: configfile path={{ psql_conf_dir }}/postgresql.conf key=log_hostname value="on" register: restart_postgresql when: - - psql_listen_on_ext_int | bool + - psql_listen_on_ext_int tags: [ 'postgresql', 'postgres', 'pg_conf' ] - name: Set the correct permissions to the postgresql files @@ -92,8 +92,8 @@ - name: Open the postgresql service to a specific zone. firewalld: service=postgresql zone={{ postgresql_firewalld_zone }} permanent=True state=enabled immediate=True when: - - psql_listen_on_ext_int | bool - - firewalld_enabled | bool + - psql_listen_on_ext_int + - firewalld_enabled - name: Give access to the remote postgresql client lineinfile: name={{ psql_el_conf_dir }}/pg_hba.conf regexp="^host.* {{ item.0.name }} {{ item.0.user }} {{ item.1 }}.*$" line="host {{ item.0.name }} {{ item.0.user }} {{ item.1 }} md5" @@ -101,10 +101,10 @@ - '{{ psql_db_data | default([]) }}' - allowed_hosts when: - - psql_listen_on_ext_int | bool + - psql_listen_on_ext_int - psql_db_data is defined - item.1 is defined - - not psql_force_ssl_client_connection | bool + - not psql_force_ssl_client_connection notify: Reload postgresql tags: [ 'postgresql', 'postgres', 'pg_hba', 'pg_db' ] @@ -114,10 +114,10 @@ - '{{ psql_db_data | default([]) }}' - allowed_hosts when: - - psql_listen_on_ext_int | bool + - psql_listen_on_ext_int - psql_db_data is defined - item.1 is defined - - psql_force_ssl_client_connection | bool + - psql_force_ssl_client_connection notify: Reload postgresql tags: [ 'postgresql', 'postgres', 'pg_hba', 'pg_db' ] @@ -141,14 +141,14 @@ action: configfile path={{ psql_el_conf_dir }}/postgresql.conf key=listen_addresses value="'*'" register: restart_postgresql when: - - psql_listen_on_ext_int | bool + - psql_listen_on_ext_int tags: [ 'postgresql', 'postgres', 'pg_conf' ] - name: If postgresql is only accessed from localhost make it listen only on the localhost interface action: configfile path={{ psql_el_conf_dir }}/postgresql.conf key=listen_addresses value="'localhost'" register: restart_postgresql when: - - not psql_listen_on_ext_int | bool + - not psql_listen_on_ext_int tags: [ 'postgresql', 'postgres', 'pg_conf' ] - name: Log the connections @@ -167,7 +167,7 @@ action: configfile path={{ psql_el_conf_dir }}/postgresql.conf key=log_hostname value="on" register: restart_postgresql when: - - psql_listen_on_ext_int | bool + - psql_listen_on_ext_int tags: [ 'postgresql', 'postgres', 'pg_conf' ] - name: Set the correct permissions to the postgresql files