diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 788e64d25c3..2e7c02b7850 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -152,7 +152,7 @@ FILE_COMMON_ARGUMENTS=dict( selevel = dict(), setype = dict(), # not taken by the file module, but other modules call file so it must ignore them. - content = dict(), + content = dict(no_log=True), backup = dict(), force = dict(), remote_src = dict(), # used by assemble @@ -884,7 +884,7 @@ class AnsibleModule(object): arg_opts = self.argument_spec.get(canon, {}) no_log = arg_opts.get('no_log', False) - if no_log: + if self.boolean(no_log): log_args[param] = 'NOT_LOGGING_PARAMETER' elif param in passwd_keys: log_args[param] = 'NOT_LOGGING_PASSWORD' diff --git a/test/integration/roles/test_copy/tasks/main.yml b/test/integration/roles/test_copy/tasks/main.yml index e168bead9b1..9266a32685c 100644 --- a/test/integration/roles/test_copy/tasks/main.yml +++ b/test/integration/roles/test_copy/tasks/main.yml @@ -89,6 +89,7 @@ assert: that: - "copy_result3|changed" + - "'content' not in copy_result3" # test recursive copy @@ -180,3 +181,4 @@ - "copy_result6.changed" - "copy_result6.dest == '{{output_dir|expanduser}}/multiline.txt'" - "copy_result6.md5sum == '1627d51e7e607c92cf1a502bf0c6cce3'" +