Open moserke opened 11 years ago
Looks like it was baked into the hook/repo LWRP load_current_resource method. I'll do some research to see if it can't be conditional here: https://github.com/bflad/chef-stash/blob/master/libraries/helper.rb#L102
Are you definitely positive its actually installing the RubyGem each time? Can run in DEBUG mode to truly see. According to CHEF-4043 and looking at the underlying Chef provider code, it should be checking for current Gem versions before actually installing anything.
That said, any reason this doesn't just use chef_gem instead of manually coding in the ChefGem bits? Should be able to set sources directly to any local/remote source just fine this way so its functionally equivalent.
You are correct, I should have said the gem package runs it's idempotence check, which takes time. It does not actually "install" each time. I moved the flag of whether it is installed to a class variable so that it only needed to check once and cut down on the number of gem package checks.
I am manually coding it up like that in the LWRP so as to be able to force the resource to be run right then without the user having to put the dependencies in their own recipes or having a recipe in the stash cookbook that the use would have to remember to include.
That being said, yup, I could have used the chef_gem resource since it is run immediately instead of wiring up the gem_package and then forcing it to run...
Every time the LWRP is run it tries to install chef-vault