mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
added unsafe toggle to vars_prompt (#49219)
* added unsafe toggle to vars_prompt fixes #47534
This commit is contained in:
@@ -109,6 +109,12 @@ tests = [
|
||||
'test_spec': [
|
||||
[('prompting for host:', 'testhost\r')],
|
||||
r'testhost.*ok=1']},
|
||||
|
||||
# Test play unsafe toggle
|
||||
{'playbook': 'unsafe.yml',
|
||||
'test_spec': [
|
||||
[('prompting for variable:', '{{whole}}\r')],
|
||||
r'testhost.*ok=2']},
|
||||
]
|
||||
|
||||
for t in tests:
|
||||
|
||||
20
test/integration/targets/vars_prompt/unsafe.yml
Normal file
20
test/integration/targets/vars_prompt/unsafe.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
- name: Test vars_prompt unsafe
|
||||
hosts: testhost
|
||||
become: no
|
||||
gather_facts: no
|
||||
vars:
|
||||
whole: INVALID
|
||||
vars_prompt:
|
||||
- name: input
|
||||
prompt: prompting for variable
|
||||
unsafe: true
|
||||
|
||||
tasks:
|
||||
- name:
|
||||
assert:
|
||||
that:
|
||||
- input != whole
|
||||
- input != 'INVALID'
|
||||
|
||||
- debug:
|
||||
var: input
|
||||
Reference in New Issue
Block a user