-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ansible 2.0 prompts for vars_prompt when --extra-vars is used #13770
Comments
so there is code that checks for this (and it used to work) https://github.com/ansible/ansible/blob/devel/lib/ansible/executor/playbook_executor.py#L114 But for some reason |
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 ansible#13770
@chlunde can you test the PR above and confirm the fix? |
Thanks! It works as expected on my playbook now. |
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
Where is this behavior documented? I can't find anything in the official docs. |
Since extra vars have higher priority than play vars, it makes sense that there is no need to prompt for a value you have already overridden. Still, we should make note in vars_prompts docs about this. |
Issue Type
Bug Report
Ansible Version
2.0 from the "stable-2.0" branch, commit 91c7691
Ansible Configuration
No changes
Environment
RHEL 7
Summary
Ansible 2.0 stops execution and requests the user to enter variables specified with
vars_prompt
even if the same variable has been specified on the comand line.Ansible 1.9.4 does not prompt for
vars_prompt
if--extra-vars
specifies the same variable.Steps To Reproduce:
playbook.yml
Expected Results:
Non-interactive run, as on 1.9.4:
Actual Results:
The user is prompted:
The text was updated successfully, but these errors were encountered: