Hi Brian,

On 08.02.17 17:49 Brian Coca wrote:

> One final clarification, you CAN override the inventory from the 
> command line, but not via the specific switches, through
> extra-vars
> 
> ansible -e 'ansible_user=xyz' ...

I think this bit is missing in the docs. Or rather, many people might
be confused what "extra vars" are. Or they might not know the
difference between "-e 'ansible_user=foo'" and "-u foo".

This may also be true for other items in the variable precedence list.
I guess not that many people have used a "play vars_prompt".

> Connection vars follow normal variable precedence, so extra_vars 
> always have the highest precedence and override all other sources.
> The command line switches override the configs, but not the 
> directives/connection variables as those are considered 'more 
> specific'.

I was very pleased to see the very detailed precendence table appear here:
https://docs.ansible.com/ansible/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable

> It can be a bit confusing, but the system is designed to allow for 
> very complex environments, as such it does assume some of that 
> complexity itself.

But that's what allows it to do so many wonderful things... ;-)

Johannes

-- 
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/a72ef7fd-8335-5b3f-04a4-a2c3a2396d65%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to