-
Notifications
You must be signed in to change notification settings - Fork 110
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
Windows bootstrap does not detect existing chef installation #439
Comments
Different approaches for detecting if chef-client is installed using batch
Trying to run chef-client.bat —version would be compatible even with really old shells, however it also adds several seconds to the bootstrap process. |
You could try using my PR #435. It will still download The client, but will continue straight after because I replaced the 5 minute wait for a blocking, non-parallel MSI run. Also skipping the download won’t be difficult to add to that PR but that would make it a bit messy. It would help if someone merged it. |
Brain dump for myself: Trying to use WHERE since it is native to batch
There is some issue with delayed evaluation that I have yet to figure out. Also trying to not save the WHERE command to a variable and execute it directly
Trying to make a new 'function' ( I think that is what batch calls them)
no longer errors, but somehow still enters the :install code
|
Chef client 12.20.21
Windows 2012r2
Problem
If you install chef on your golden image, the install.ps1 script will not detect it, and will re-download chef when bootstrapping.
Additional Information
We use packer to create windows 2012R2 golden images, (based off of the bento boxes and Matt Wrocks images)
One of the packer steps installs chef using omnibus
The golden image has chef installed
Yet, every machine that gets bootstrapped, reinstalls chef. When spinning up dozens or hundreds of windows vms, this adds a lot of unnecessary delay. The windows
install.ps1
script should behave more like the linuxinstall.sh
script and intelligently detect existing chef installs.Here is the intelligence in the linux script
https://github.com/chef/chef/blob/db57131ad383076391b9df32d5e9989cfb312d58/lib/chef/knife/bootstrap/templates/chef-full.erb#L165-L176
It runs
Here is the windows install.ps1 script
https://github.com/chef/knife-windows/blob/master/lib/chef/knife/bootstrap/windows-chef-client-msi.erb
The two scripts would be more similar if the
install.ps1
did something like:Or a more batch friendly command
The text was updated successfully, but these errors were encountered: