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

Run an arbitrary command before provisioning #311

Closed

Conversation

coderanger
Copy link
Contributor

It would be nice if I could run a command (in this case apt-get install curl) before installing Chef. This would also help for provisioning OSes not in omnitruck.

@someara
Copy link

someara commented Jan 7, 2014

+1 works for me

@sethvargo
Copy link
Contributor

We are going to track this as #329. We have reservations about permitting the arbitrary execution of commands, since it diverges the test suite from the actual infrastructure.

Ultimately, this functionality will become available when #329 is fully flushed out, since you will be able to hook into a lifecycle command (before_provision in your example) and execute "code".

@sethvargo sethvargo closed this Jan 17, 2014
@bknowles
Copy link

This would also be great for those of us who need to do "apt-get update" before doing anything else in the run_list.

Much appreciated! Thanks!

@sethvargo
Copy link
Contributor

@bknowles the solution to that issue it to have a dev dep on apt and include it in the run_list: https://github.com/opscode-cookbooks/jenkins/blob/master/.kitchen.yml#L22-L26

@coderanger
Copy link
Contributor Author

@sethvargo Unfortunately that doesn't work on platforms where you cannot install Chef, such as default CentOS 5 images.

@bknowles
Copy link

@sethvargo that's actually exactly what we're doing. See my gist at https://gist.github.com/bknowles/d8aa92c5823b3312dd9a

But it would still be nice to build something like this into the test part of the framework, instead of having to have this dependency explicitly called out in each and every recipe.

@someara
Copy link

someara commented Jan 17, 2014

There are many situations where a base image won't have wget, curl, CA
certificates, etc etc.
This should only be used to prep the image to receive Chef.

On Fri, Jan 17, 2014 at 6:02 PM, Noah Kantrowitz
notifications@github.comwrote:

@sethvargo https://github.com/sethvargo Unfortunately that doesn't work
on platforms where you cannot install Chef, such as default CentOS 5 images.


Reply to this email directly or view it on GitHubhttps://github.com//pull/311#issuecomment-32661035
.

@coderanger
Copy link
Contributor Author

Yep, either installing curl or installing a real CA bundle are the common use cases, or manually installing Chef if omnitruck isn't available (new platform, etc).

@sethvargo
Copy link
Contributor

Right, and you'll be able to do that after #329

@timothy-spencer
Copy link

Given that #329 seems to not be going anywhere, is this something that could land in the spirit of "don't let best be the enemy of good"? I am suffering because of the lack of this.

@someara
Copy link

someara commented Sep 25, 2017

For what it's worth... kitchen-dokken lets you do this with intermediate_instructions

@timothy-spencer
Copy link

Sadly, we use kitchen-ec2. I have certs for a proxy that I need to trust before anything can work. :-(

@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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants