From 558c6b6d1407f76631df0dbf87f7cca5e4de2176 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 20 Mar 2020 10:42:52 -0500 Subject: [PATCH] Fixes #110: no_log setting cannot be overridden. --- README.md | 4 ++++ defaults/main.yml | 3 +++ tasks/users.yml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d81e4e..d447a6e 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,10 @@ A list of databases to ensure exist on the server. Only the `name` is required; A list of users to ensure exist on the server. Only the `name` is required; all other properties are optional. + postgres_users_no_log: true + +Whether to output user data (which may contain sensitive information, like passwords) when managing users. + postgresql_version: [OS-specific] postgresql_data_dir: [OS-specific] postgresql_bin_path: [OS-specific] diff --git a/defaults/main.yml b/defaults/main.yml index fa6a87f..0e2d503 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -62,3 +62,6 @@ postgresql_users: [] # login_unix_socket: # defaults to 1st of postgresql_unix_socket_directories # port: # defaults to not set # state: # defaults to 'present' + +# Whether to output user data when managing users. +postgres_users_no_log: true diff --git a/tasks/users.yml b/tasks/users.yml index 34746eb..a1ae894 100644 --- a/tasks/users.yml +++ b/tasks/users.yml @@ -14,7 +14,7 @@ port: "{{ item.port | default(omit) }}" state: "{{ item.state | default('present') }}" with_items: "{{ postgresql_users }}" - no_log: true + no_log: "{{ postgres_users_no_log }}" become: true become_user: "{{ postgresql_user }}" # See: https://github.com/ansible/ansible/issues/16048#issuecomment-229012509