added unsafe toggle to vars_prompt (#49219)

* added unsafe toggle to vars_prompt

	fixes #47534
This commit is contained in:
Brian Coca
2019-01-30 15:01:13 -05:00
committed by GitHub
parent 4a0fceaa3b
commit 4ac0c23db6
7 changed files with 51 additions and 10 deletions

View File

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

View 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