jtimberman/vagrant-cookbook — pull request #14 by jtimberman (2014-12-08 05:17:40+00:00)
Title: Implement user-specific plugin installation

This commit implements the oft-requested user-specific plugin installation.
This resolves the pull requests: #2, #4, #8.

A huge thank you goes out to everyone who took the time to open these
pull requests, and participate in discussion on them. Thank you:
@patcon, @hugofonseca, @sneal, @kowal, @pwelch, @oker1, @adamjk-dev,
@amferraz, @englishm, and @arangamani. My apologies for terse
responses and lack of action/decision on this for so long.

Notable changes:

Add a test cookbook that implements two scenarios of plugin installation. The
first is for a user that will exist in a test-kitchen environment - vagrant.
The second is for a user created during the chef run itself, to prove we can
look up the user and get the right home directory.

A new `user` attribute, which is a "global" default if using the plugins
attribute to install a list of plugins. This assumes a single user will have
vagrant plugins. Consumers of this cookbook with multiple users that have
vagrant installations on a single system will need to implement their own
recipes.

Add a helper method, `vagrant_get_home`, that attempts to be smart about
detecting the user for plugin installation.

Refactor the provider actions to use `execute` resources (and add
`use_inline_resources`). This gives us the benefit of built-in
`converge_by`, and thus why-run support. It also makes the action blocks
easier to read.

Move the plugin installation loop out of the default recipe and into its own
recipe. This gives consumers flexibility, and decouples the functionality.