我一直在尝试在 azure vm windows 2016 数据中心映像中使用打包程序安装厨师客户端,但在创建映像后,我在厨师工作站中检查了带有厨师客户端配置机器的图像未连接到厨师服务器。
是否需要手动执行knife命令?但是 Knife 命令需要 vm 的私有 IP,所以使用 Chef-client 配置的镜像如何自动连接到 Chef 服务器?
这是我尝试过的模板代码:
{
"type": "chef-client",
"install_command": "powershell.exe -Command (New-Object System.Net.WebClient).DownloadFile('http://chef.io/chef/install.msi', 'C:\\Windows\\Temp\\chef.msi');Start-Process 'msiexec' -ArgumentList '/qb /i C:\\Windows\\Temp\\chef.msi' -NoNewWindow -Wait",
"Server_Url": "https://api.chef.io/organizations/xyz",
"Guest_Os_Type": "Windows",
"Chef_Environment": "",
"Ssl_Verify_Mode": "Verify_None",
"chef_license": "accept",
"Validation_Client_Name": "xyz94",
"Validation_Key_Path": "C:/packer/packer-repo/packer-master/DE/setup_files/xyz94.pem",
"Skip_Clean_Client": "True",
"Skip_Clean_Node": "False"
}