1

I have been trying to install chef-client using packer in azure vm windows 2016 datacenter image but after creating image i checked in chef workstation that the image with chef-client configuration machine is not connected to chef server.

Is it necessary to perform knife command manually? but knife commands need private IP of vm so how can image with chef-client configuration will auto connect to the chef server?

Here is template code that i have tried:

{

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

}
  • 1
    Hi. Welcome here. Questions with some context and proper formatting are more likely to attract answers. Please see [how to ask](https://stackoverflow.com/help/how-to-ask). – seshadri_c Jan 07 '21 at 13:03
  • 1
    I have made some changes in code as well as question, currently i have been successfully able to install chef-client package , but it is not connected to chef server. – sushant chavan Jan 20 '21 at 09:54
  • 1
    Which command did you use ti check ? and what are packer logs ? – Tensibai Jan 30 '21 at 22:08

0 Answers0