Additional LWRP options (with tests), including execute as non-root
This PR was created to address two issues... successfully installing a ruby as a non-privileged user (eg. to ~/.rubies with proper ownership) and to allow patched installations.
To install a ruby as a non-root user (eg. as vagrant:vagrant into ~/.rubies), we need to be able to pass the --no-install-deps flag to ruby-install. Otherwise the run will likely puke when ruby-install is executed as non-root and attempts to sudo to install deps (well, at leat in my test env). To allow for patched installs, we need the --patch option. In addition to these options, I also added some others for the sake of completeness (though not all of them).
I also included a commit that contains a test cookbook user_ruby and related test-kitchen suites and serverspec tests to exemplify the items mentioned above. This includes a) installing a ruby as vagrant to its home directory, and b) installing a patched ruby 2.0 into Ubuntu-14.04 (which is otherwise impossible to install due to issues w/ readline).
The user_ruby test cookbook includes some comments to give an example pattern of installing a ruby to a user's home directory. As long as the install_deps attribute is exposed in the LWRP, this should address issue #1. With it, the only attributes needed to install a ruby is the username of an (existing) user and the actual ruby to be installed. The rest can be determined with some help from our good friend etc.
As a side note, some of the logic included in the user_ruby test cookbook could be integrated directly into the LWRP, albeit at the possible expense of making it slightly more "opinionated". I guess it depends on whether the intent is to leave it all up to the implementer, or to provide reasonable (and overridable) defaults that mimic the actual ruby-install command. I'll save that for another comment/issue.
Please feel free to merge, cherry-pick, provide feedback for edits, etc.
This looks like awesome work. Please give me a day or two to test this and get a new release out. Thanks you very much!
Thanks! (and sorry for the delayed response). You might want to sit on this PR and leave it open for a while. I took the liberty of banging around on your LWRP today and hope to push something this weekend. It should include most everything addressed in this PR, but should deal with most of it within the LWRP itself. I hope to have some unit and integration tests done this weekend (almost there).
Current progress is here
@bdclark Still sitting on this. Is this something you are still looking at doing when you get some time or shall I just look to pull in what we've got here?
Sorry about that @rosstimson... got a new job recently and have been overwhelmed. For now let's ignore my last comment, I'll drop my second wip branch and possibly revisit later. I'll leave this PR intact, so feel free to move forward with it if you want to. Thx!