diff --git a/defaults/main.yml b/defaults/main.yml index 311a309..5db7c39 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -59,7 +59,7 @@ postgres_db: [] # template: "template0" # login_host: "localhost" # login_password: "_omit_" -# login_user: "{{ postgresql_user }}" +# login_user: "{{ postgres_user }}" # login_unix_socket: "_omit_" # port: "_omit_" # owner: "_omit_" @@ -91,3 +91,5 @@ postgres_hba_entries: auth_method: md5 postgres_hba_entries_extra: [] + +postgres_no_log: True diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml index a821a0a..69347a5 100644 --- a/molecule/default/playbook.yml +++ b/molecule/default/playbook.yml @@ -5,6 +5,7 @@ postgres_repository_enabled: True postgres_db: - name: demo + postgres_no_log: False roles: - role: xoxys.postgres diff --git a/tasks/config.yml b/tasks/config.yml index 2b1d9fc..e00a0e3 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -13,7 +13,7 @@ password: "{{ item.password | password_hash('sha512', 65534 | random(seed=inventory_hostname) | string) }}" state: "{{ item.state | default('present') }}" loop: "{{ postgres_users }}" - no_log: True + no_log: "{{ postgres_no_log }}" when: item.pam_user | default(False) - name: Setup client authentication diff --git a/tasks/post_tasks.yml b/tasks/post_tasks.yml index faef431..fdc7bf1 100644 --- a/tasks/post_tasks.yml +++ b/tasks/post_tasks.yml @@ -11,12 +11,12 @@ template: "{{ item.template | default('template0') }}" login_host: "{{ item.login_host | default('localhost') }}" login_password: "{{ item.login_password | default(omit) }}" - login_user: "{{ item.login_user | default(postgresql_user) }}" + login_user: "{{ item.login_user | default(postgres_user) }}" login_unix_socket: "{{ item.login_unix_socket | default(omit) }}" port: "{{ item.port | default(omit) }}" owner: "{{ item.owner | default(omit) }}" state: "{{ item.state | default('present') }}" - #no_log: True + no_log: "{{ postgres_no_log }}" loop: "{{ postgres_db + postgres_db_extra }}" become: True become_user: "{{ postgres_user }}" @@ -35,7 +35,7 @@ login_unix_socket: "{{ item.login_unix_socket | default(postgres_socket_directories[0]) }}" port: "{{ item.port | default(omit) }}" state: "{{ item.state | default('present') }}" - no_log: True + no_log: "{{ postgres_no_log }}" loop: "{{ postgres_users + postgres_users_extra }}" become: True become_user: "{{ postgres_user }}"