That is pretty weird, because “when” I tested it this morning I swear it 
skipped the prompt when I passed in —extra-vars “release_branch=staging”. 

- Jeremy 

From: Michael DeHaan <[email protected]>
Reply: Michael DeHaan <[email protected]>>
Date: August 27, 2014 at 1:37:06 PM
To: Jeremy Gailor <[email protected]>>
Cc: [email protected] <[email protected]>>
Subject:  Re: [ansible-project] Inventory vars in a playbook  

Yep, sounds good.

IIRC, "when" cannot be applied to a vars_prompt.





On Wed, Aug 27, 2014 at 4:32 PM, Jeremy Gailor <[email protected]> wrote:
To clarify, the full block is:

/my_playbook.yml
- hosts: webapps
  vars_prompt:
    - name: "release_branch"
      prompt: "Deploy Branch:"
      default: master
      when: not release_branch

Ansible will skip this block if release_branch is passed in --extra-args.  
Thinking it through, maybe it's worth just having it passed in on the command 
line if it needs to be set and falling back to the inventory as a default.  
Thanks for the help.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/etPan.53fe41da.625558ec.18fc%40GenghisKhan.
For more options, visit https://groups.google.com/d/optout.

Reply via email to