Reputation: 383
I have definitely installed knife-windows. Chef gem list shows knife-windows but when I run bootstrap I'm told it's not installed.
sudo -u user -H sh -c "cd /home/user/chef-repo/; chef gem list"
sudo -u user -H sh -c "cd /home/user/chef-repo/; knife bootstrap windows winrm $VMIP -r 'role[build_server]' -x 'domain\user' -V -P 'password'"
Output
First command shows: knife-windows (0.8.5, 0.8.3)
Second:
INFO: Using configuration from /home/user/.chef/knife.rb
WARNING: Hostname containing 'windows' specified. Please install 'knife-windows' if you are attempting to bootstrap a Windows node via WinRM.
Doing old-style registration with the validation key at /home/user/.chef/myserver-validator.pem...
Delete your validation key in order to use your user credentials instead
Is there something obvious I'm missing?
Cheers
Upvotes: 1
Views: 765
Reputation: 1426
Looks like your ChefDK setup is incomplete, because your sudo command calls /usr/bin/knife
which looks like a rubygems-based knife
, not ChefDK.
Please make sure to add ChefDK to the $PATH of the user, as described here: https://docs.chef.io/install_dk.html#add-ruby-to-path
Depending on your setup, you also want to use sudo -i
to execute the command within a login shell.
Upvotes: 1