1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/vars_prompt/vars_prompt-6.yml
Sam Doran 6d38167d49
Only template values in vars_prompt rather than all vars (#39304)
* Only template values in vars_prompt rather than all vars

This allows the use of variables in vars_prompt fields but allows variables entered in the prompt to affect play vars rather than throwing an undefined error.

Only post validate if there was a vars_prompt

* Add tests for vars_prompt
2018-08-13 12:54:31 -04:00

20 lines
327 B
YAML

- name: Test vars_prompt custom variables in prompt
hosts: testhost
become: no
gather_facts: no
vars:
prompt_var: prompt from variable
vars_prompt:
- name: input
prompt: "{{ prompt_var }}"
tasks:
- name:
assert:
that:
- input == 'input'
- debug:
var: input