From 1cc5ac06e70630f61423aa1576234c54faabf8cd Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 8 Jan 2016 11:43:27 -0500 Subject: [PATCH] restructure vars_prompt and fix regression pushed it to use the existing propmpt from display and moved the vars prompt code there also for uniformity changed vars_prompt to check extra vars vs the empty play.vars to restore 1.9 behaviour sipmlified the code as it didn't need to check for syntax again (tqm is made none prior based on that) fixes #13770 --- lib/ansible/executor/playbook_executor.py | 54 ++--------------------- lib/ansible/utils/display.py | 47 +++++++++++++++++++- 2 files changed, 49 insertions(+), 52 deletions(-) diff --git a/lib/ansible/executor/playbook_executor.py b/lib/ansible/executor/playbook_executor.py index 60a416af73d..eecaa66a62c 100644 --- a/lib/ansible/executor/playbook_executor.py +++ b/lib/ansible/executor/playbook_executor.py @@ -111,13 +111,12 @@ class PlaybookExecutor: salt_size = var.get("salt_size", None) salt = var.get("salt", None) - if vname not in play.vars: + if vname not in self._variable_manager.extra_vars: + self._tqm.send_callback('v2_playbook_on_vars_prompt', vname, private, prompt, encrypt, confirm, salt_size, salt, default) if self._tqm: - self._tqm.send_callback('v2_playbook_on_vars_prompt', vname, private, prompt, encrypt, confirm, salt_size, salt, default) - if self._options.syntax: + play.vars[vname] = display.do_var_prompt(vname, private, prompt, encrypt, confirm, salt_size, salt, default) + else: # we are either in --list-