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.
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.
I’ve used multiple vars similar to your second example for quite a while, and it’s documented to be used like that, 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:
I started reading the code and I agree it is a feature. I would recommend looking at this file to see how the playbook treats each option. Very informative:
ansible/lib/ansible/cli/init.py