Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Chef-vault installs over and over again #7

Open
moserke opened this issue May 28, 2013 · 3 comments
Open

Chef-vault installs over and over again #7

moserke opened this issue May 28, 2013 · 3 comments

Comments

@moserke
Copy link
Contributor

moserke commented May 28, 2013

Every time the LWRP is run it tries to install chef-vault

@bflad
Copy link
Owner

bflad commented May 30, 2013

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

@bflad
Copy link
Owner

bflad commented May 30, 2013

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.

@moserke
Copy link
Contributor Author

moserke commented May 30, 2013

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...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants