mirror of https://github.com/ansible/ansible.git
no_log avoid masking booleans (#82217)
* no_log avoid masking booleans * clog * fix issuespull/82232/head
parent
f42984eeb3
commit
6e448edc63
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- module no_log will no longer affect top level booleans, for example ``no_log_module_parameter='a'`` will no longer hide ``changed=False`` as a 'no log value' (matches 'a').
|
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/python
|
||||
from __future__ import annotations
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(argument_spec=dict(
|
||||
secret=dict(no_log=True),
|
||||
notsecret=dict(no_log=False),
|
||||
))
|
||||
|
||||
msg = "My secret is: (%s), but don't tell %s" % (module.params['secret'], module.params['notsecret'])
|
||||
module.exit_json(msg=msg, changed=bool(module.params['secret'] == module.params['notsecret']))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Reference in New Issue