Revert only_if for variables and templating prompt
Since the condition was not templated, it wasn't working. Only variables in local scope were used, which made this not very practical
This commit is contained in:
parent
10bce54ef0
commit
e7af005408
1 changed files with 2 additions and 4 deletions
|
@ -165,16 +165,14 @@ class Play(object):
|
|||
raise errors.AnsibleError("'vars_prompt' item is missing 'name:'")
|
||||
|
||||
vname = var['name']
|
||||
prompt = utils.template(None, "%s: " % var.get("prompt", vname), self.vars)
|
||||
prompt = var.get("prompt", vname)
|
||||
private = var.get("private", True)
|
||||
|
||||
confirm = var.get("confirm", False)
|
||||
encrypt = var.get("encrypt", None)
|
||||
salt_size = var.get("salt_size", None)
|
||||
salt = var.get("salt", None)
|
||||
conditional = var.get("only_if", 'True')
|
||||
|
||||
if utils.check_conditional(conditional):
|
||||
vars[vname] = self.playbook.callbacks.on_vars_prompt(vname, private, prompt,encrypt, confirm, salt_size, salt)
|
||||
|
||||
elif type(self.vars_prompt) == dict:
|
||||
|
|
Loading…
Reference in a new issue