1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #1115 from dagwieers/only_if-revert

Revert only_if for variables and templating prompt, little practical use
This commit is contained in:
Michael DeHaan 2012-09-27 16:43:24 -07:00
commit d68f22a28d

View file

@ -165,16 +165,14 @@ class Play(object):
raise errors.AnsibleError("'vars_prompt' item is missing 'name:'") raise errors.AnsibleError("'vars_prompt' item is missing 'name:'")
vname = var['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) private = var.get("private", True)
confirm = var.get("confirm", False) confirm = var.get("confirm", False)
encrypt = var.get("encrypt", None) encrypt = var.get("encrypt", None)
salt_size = var.get("salt_size", None) salt_size = var.get("salt_size", None)
salt = var.get("salt", 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) vars[vname] = self.playbook.callbacks.on_vars_prompt(vname, private, prompt,encrypt, confirm, salt_size, salt)
elif type(self.vars_prompt) == dict: elif type(self.vars_prompt) == dict: