Stuck trying to bootstrap Windows server using Chef

巧了我就是萌 提交于 2019-12-03 13:50:58
Mohan Karthik Sanagapalli

Purge & Install it with:

gem uninstall knife-windows  
gem install knife-windows -v 0.5.10   

check your gems with:

gem list | grep knife-windows  

And it should show knife-windows (0.5.10).

Configure the window remote management

  1. winrm quickconfig -q   
  2. winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}  
  3. winrm set winrm/config @{MaxTimeoutms="1800000"}  
  4. winrm set winrm/config/service @{AllowUnencrypted="true"}
  5. winrm set winrm/config/service/auth @{Basic="true"}

and then bootstrapped:

knife bootstrap windows winrm ec2-xx-xxx-xx.compute-1.amazonaws.com -r 'recipe[cookbook]' -x Administrator -P xxxxxxxx
themathmagician

In my case, RVM was the responsible culprit. I managed to resolve this issue by following steps:

1) downloading and installing Chef the omnibus installer from Opscode

curl -L https://www.opscode.com/chef/install.sh | sudo bash

2) Installing knife-windows directly in chefs library:

Navigate to /opt/chef/embedded/bin/gem

Disable rvm by using system ruby:

rvm use system

3) Install knife windows plugin :

/opt/chef/embedded/bin/gem install knife-windows

Now I can bootstrap my Windows Server node using the command

knife bootstrap windows winrm <IP Address> -p 5985  -x Administrator -P '<password>'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!