mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
[PR #10710/b5a2c581 backport][stable-11] random_string: Specify seed while generating random string (#10748)
random_string: Specify seed while generating random string (#10710)
* random_string: Specify seed while generating random string
* Allow user to specify seed to generate random string
Fixes: #5362
* Apply suggestions from code review
---------
(cherry picked from commit b5a2c5812c)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
result11: "{{ query('community.general.random_string', base64=true, length=8) }}"
|
||||
result12: "{{ query('community.general.random_string', upper=false, numbers=false, special=false) }}" # all lower case
|
||||
result13: "{{ query('community.general.random_string', override_all='0', length=2) }}"
|
||||
result14: "{{ query('community.general.random_string', seed='1234') }}"
|
||||
result15: "{{ query('community.general.random_string', seed='1234') }}"
|
||||
|
||||
- name: Raise error when impossible constraints are provided
|
||||
set_fact:
|
||||
@@ -51,3 +53,4 @@
|
||||
- result13[0] == '00'
|
||||
- impossible_result is failed
|
||||
- "'Available characters cannot' in impossible_result.msg"
|
||||
- result15[0] == result14[0]
|
||||
|
||||
Reference in New Issue
Block a user