Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kitchen converge reinstalls chef using the omnibus installer even if its installed #299

Closed
jchauncey opened this issue Dec 20, 2013 · 7 comments

Comments

@jchauncey
Copy link

So I issue a kitchen converge and it installs chef and runs the provided run list. I make a tweak to a cookbook and rerun kitchen converge and it will reinstall chef using the omnibus installer.

@adnichols
Copy link

I've observed this behavior as well - it appears that test-kitchen doesn't properly detect an existing chef install. This hurt me in two ways:

  1. Last week when install.sh was exiting w/ a non-zero status due to an existing install there was no way to converge more than once.

  2. For plugins like kitchen-docker which have the ability to pre-install chef for you, test-kitchen still tries to install chef. Super annoying.

@fnichol
Copy link
Contributor

fnichol commented Dec 20, 2013

For both of you what is your value of require_chef_omnibus? There are several different behaviors available:

  • true - the latest release will be installed. Subsequent converges
    will skip re-installing if chef is present.
  • latest - the latest release will be installed. Subsequent converges
    will always re-install even if chef is present.
  • <VERSION_STRING> (ex: 10.24.0) - the desired version string will
    be passed the the install.sh script. Subsequent converges will skip if
    the installed version and the desired version match.
  • false or nil - no chef is installed.

The true value is almost certainly what you want in most circumstances if you don't care about the version of Chef. There is short circuiting logic in the Chef provisioners to skip over existing installations for this reason.

Note that as of the 1.0.0 release both the chef_solo and chef_zero provisioners now have a default config of require_chef_omnibus: true which only installs Chef if not present.

@adnichols For kitchen-docker, you can use the provision_command: curl -L https://www.opscode.com/chef/install.sh | bash in a driver block to let docker commit the omnibus install as a filesystem layer and this should continue to work with require_chef_omnibus: true. I'm using this setup more and more these days.

@adnichols
Copy link

@fnichol testing this morning it looks like this is behaving as expected. I think the problem is that we're putting a partial version in our cookbooks (11.8 for example) which causes chef to be installed every time. If I set it to the exact version (11.8.2) or true/false it doesn't re-install. This works fine w/ kitchen-docker as well.

I was already taking advantage of the provision_command in kitchen-docker so it was confusing why chef was being re-installed but I think the partial version string is the culprit.

Aaron

@fnichol
Copy link
Contributor

fnichol commented Dec 20, 2013

@adnichols Aha, I had not considered a "fuzzy" versioning usage like that. If that was supported in the install.sh script we might be able to allow it in Test Kitchen--just match the version string with a carefully crafted regular expression. Good to hear you're back on the fast track!

@jchauncey
Copy link
Author

doh! we thought we were getting clever. Thanks for the insight =)

@adnichols
Copy link

@fnichol The fuzzy matching does seem to work for the installer - w/ 11.8 specified we get 11.8, w/ 11.4 we get 11.4.4 or something like that.

@fnichol
Copy link
Contributor

fnichol commented Dec 20, 2013

@adnichols Cool, I'll try to give this a spin today. It would be cool to allow require_chef_omnibus: 10 and require_chef_omnibus: 11 if possible.

BrentOnRails pushed a commit to BrentOnRails/test-kitchen that referenced this issue Jul 17, 2017
@test-kitchen test-kitchen locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants