[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:
patchback[bot] 2025-08-27 22:09:41 +02:00 committed by GitHub
commit dac26d12bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 4 deletions

View file

@ -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]