I've used multiple vars similar to your second example for quite a while, and it's documented to be used like that <http://docs.ansible.com/ansible/playbooks_variables.html#passing-variables-on-the-command-line>, so I believe it is a feature, not a bug. I'm not sure I have ever used quotes inside the extra vars list, but I would guess you can use singles inside the doubles.
The following is how I have frequently used extra-vars: ansible-playbook playbook.yml --extra-vars "hosts=hosts-group user=ansible-user var2=27" Joanna On Tuesday, March 1, 2016 at 3:33:30 PM UTC-6, Arthur Reyes wrote: > > I didn't see it listed in Issues, so I thought I would ask here if a > recent discovery was actually a bug. > > I'm working on some shell wrappers for the ansible-playbook and wanted to > maintain a certain level of pedantry. It appears that ansible-playbook will > except multiple --extra-vars options and append them to a single argv, > which is what I expect from Python. > > In other words, this: > > ansible-playbook site.yml --extra-vars "hosts='*CUS03*'" --extra-vars > "foo=''" --extra-vars "bar='Yes'" > > > Is the same as this: > > > ansible-playbook site.yml --extra-vars "hosts='*CUS03*' foo='' bar='Yes'" > > > This is a good thing for me, but before I continue working on a wrapper > that relies on this behavior, I figured I should ask around to see if this > is actually an Issue. > > > Thank you, > > > > Arthur > -- 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/7ee1ffd8-0fa1-45af-8952-4918cb6e8cf5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
