mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Make password lookup treat /dev/null as a special case
I have from time to time a need of random password without wanting to write them down (one example is mailman list creation, that requires a password to be given to be sent to the list owner). But using /dev/null do not return null, but the empty string, which doesn't generate a password at all and so do not achieve my use case.
This commit is contained in:
committed by
Matt Clay
parent
103ede26df
commit
6fae1d2bbf
@@ -134,6 +134,18 @@
|
||||
that:
|
||||
- "newpass == newpass2"
|
||||
|
||||
- name: verify that we can generate a 1st password without writing it
|
||||
set_fact:
|
||||
newpass: "{{ lookup('password', '/dev/null') }}"
|
||||
|
||||
- name: verify that we can generate a 2nd password without writing it
|
||||
set_fact:
|
||||
newpass2: "{{ lookup('password', '/dev/null') }}"
|
||||
|
||||
- name: verify lookup password behavior with /dev/null
|
||||
assert:
|
||||
that:
|
||||
- "newpass != newpass2"
|
||||
|
||||
# ENV LOOKUP
|
||||
|
||||
|
||||
Reference in New Issue
Block a user