ansible/ansible — pull request #6734 by sergevanginderachter (2014-03-27 20:24:12+00:00)
Title: vars_plugins refactor and move into core inventory

This patch set does a major set of things, with a big performance benefit in the case of very large inventories (tested on one with 750 hosts)

- Split out parsing of vars files from per host, triggered by runner, to per host and per group parsing, instead of (re)parsing all groups each time for every host. Introduce separate methods to parse a particular group or host and inject this into the proper Inventory objects, instead of parsing all vars for 1 host. This enhances performance.
- Introduce a noop vars plugin, to prepare to move the group_vars plugin into core.
- Move inventory.set_playbook_basedir from ansible-playbook to playbook constructor, to enable it to trigger inventory events.
- Move group/host_vars parsing from vars_plugin code into core inventory. this unifies parsing of all variables from all sources into the Inventory constructor, instead of being called for various sources from various ansible modules at various times. Also move methods to read files from the plugin, to util (including the vault specific code.)
- This patch until here has the downside to parse the *whole* inventory with *all* its vars at Inventory.init() time, which takes some more time due to the group/host_vars files loading. This was however especially a problem (as in noticeable extra time) in the case of a (very) large inventory with `hash_behaviour=merge`, which is optimized by replacing the `deepcopy` function, by manual parsing in `utils.def merge_hash(a, b):`