首页 > 解决方案 > 无法使用 packer chef-client provisioner 从 chef-client 连接到 chef-server

问题描述

我一直在尝试在 azure vm windows 2016 数据中心映像中使用打包程序安装厨师客户端,但是在创建映像后,我在厨师工作站中检查了厨师客户端配置机器的映像未连接到厨师服务器。

是否需要手动执行刀命令?但是knife命令需要vm的私有IP,那么带有厨师客户端配置的图像如何自动连接到厨师服务器?

这是我尝试过的模板代码:

{

"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"

}

标签: azurechef-infrapackerchef-client

解决方案


推荐阅读