From fa358d9d61e3264685a60cf7a7e5f6a18990bcfc Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 27 Nov 2015 11:41:00 -0800 Subject: [PATCH] avoids prompting for vars during syntax check fixes #13319 --- lib/ansible/executor/playbook_executor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/executor/playbook_executor.py b/lib/ansible/executor/playbook_executor.py index b6cbf2b1ba8..dd15039ad68 100644 --- a/lib/ansible/executor/playbook_executor.py +++ b/lib/ansible/executor/playbook_executor.py @@ -111,7 +111,10 @@ class PlaybookExecutor: if vname not in play.vars: if self._tqm: self._tqm.send_callback('v2_playbook_on_vars_prompt', vname, private, prompt, encrypt, confirm, salt_size, salt, default) - play.vars[vname] = self._do_var_prompt(vname, private, prompt, encrypt, confirm, salt_size, salt, default) + if self._options.syntax: + play.vars[vname] = default + else: + play.vars[vname] = self._do_var_prompt(vname, private, prompt, encrypt, confirm, salt_size, salt, default) # Create a temporary copy of the play here, so we can run post_validate # on it without the templating changes affecting the original object.