Closed sully255 closed 8 years ago
I recently encountered this as well. When you run "knife --help" you will see that there are no "knife bootstrap windows" subcommands listed. Just "knife bootstrap".
I found that I had both "chef" and "chefdk" installed on my machine. The knife-windows gem was installed in the /opt/chefdk/embedded directory but not in /opt/chef/embedded. The /usr/bin/knife command in my $PATH was a symbolic link to /opt/chef/bin/knife, so it looked for the gem in /opt/chef/embedded and didn't find it. My fix was to change the /usr/bin/chefdk symlink to /opt/chefdk/bin/knife instead of /opt/chef/bin/knife, and it picked up the knife-windows gem correctly.
So check where you have the knife-windows gem installed. For instance try running these commands to see where it is installed: /opt/chef/embedded/bin/gem list knife-windows /opt/chefdk/embedded/bin/gem list knife-windows /opt/opscode/embedded/bin/gem list knife-windows
Then make sure you are running the knife command that is in the same path.
That makes perfect sense but I am running the Chef Client on a Windows 2008 Server. What would the windows commands be?
On windows you can run chef shell-init powershell | Invoke-Expression
to propperly setup your PATH
That seemed to work but only in the active session. How can I make that permanent meaning once I reboot I have to run that command again.
I add it to my profile so its always there. Your profile is located at the path in the $PROFILE
automatic variable.
Also, if using chefdk, if you open powershell using the chefdk desktop icon, that will have that pre set.
That worked.
Thank you
I am not able to bootstrap a windows machine. I am getting the following error: -Hostname containing windows. Please install knife-window.
I have knife-windows gem installed. I know this because I manually installed the gem and all the perquisites but when I try to boot strap a windows machine I get the error.
Any help wold be greatly appreciated