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
This commit is contained in:
Sam Doran 2018-08-13 12:54:31 -04:00 committed by GitHub
commit 6d38167d49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 254 additions and 14 deletions

View file

@ -64,7 +64,7 @@ class Play(Base, Taggable, Become):
# Variable Attributes
_vars_files = FieldAttribute(isa='list', default=[], priority=99)
_vars_prompt = FieldAttribute(isa='list', default=[], always_post_validate=True)
_vars_prompt = FieldAttribute(isa='list', default=[], always_post_validate=False)
# Role Attributes
_roles = FieldAttribute(isa='list', default=[], priority=90)