mitchellh/vagrant — pull request #1697 by gildegoma (2013-05-06 21:54:06+00:00)
Title: Support more Ansible options

This pull request aims to solve (parts of) #1674 from @kernel164. These first commits are not thought as final, but more as discussion base (see open points below). Let me know what do you prefer (feature branch will be rebased at the very end ;-):

* I'm not sure which ansible-playbook options make sense in Vagrant context (all?). So far I didn't take time to review this point (since I was personally first interested in `tags` support). Comments and votes are welcome! Once I get the list, I can add the wanted options.

* `tags` addition: In order to keep the code as DRY as possible, I introduced `as_list_argument` private method. It could also be "inline" implemented (e.g. `"--tags=#{config.tags.kind_of?(Array) ? config.tags.join(',') : config.tags}"`), but it does not help to enforce code-style unity. I also thought about very small addition somewhere in lib/vagrant/util/... : `join_if_needed(variable, separator)` (that sounds overkill to me). @mitchellh please, let me know what is good for you...

* `verbose` change: I'm not sure if it is correct to mix boolean and string type for the same Vagrant option, but two different options would be "horrible", no? Should this attribute be more validated (raise an exception when invalid). Note, that I did not restrict to `/^v{1,3}$/`, since `ansible-playbooks` deals with improbable things like `-vvvvv`.

* `raw_arguments` addition: Like Vagrant, Ansible project is going very very fast... and I think that it will often occur (like to me for the `--tags` option), that some recent features are not already supported by latest Vagrant. Therefore, I'd like to add this unsafe joker card in the deck. About the precedence, I'm open to any minds. I intentionally put it in the middle to "debate" on this aspect. The most elegant is maybe to give it the lowest priority (even for `--user` and `--private-key`, unlike current implementation), so that any new official options will automatically overtake. @mitchellh: if this such kind of parameter is considered as bad practice for Vagrant configuration file, just tell me and I remove 66715de from this request (I always can try to convince you later with a separated pull request, if absolutely needed ;-)