packer-windows icon indicating copy to clipboard operation
packer-windows copied to clipboard

Chef-solo install on Windows7

Open bigmyx opened this issue 8 years ago • 0 comments

Hi,

I have an issue with installing Chef Client on Windows 7. The install command runs the Chef installer MSI which sets incorrect permissions on c:\opscode\chef subdirectory (c:\opscode is fine), making it inaccessible. When I execute the installer manually (either interactively or via SSH remote session) - it works. It is also working fine on Windows 8.1 It seems to related to the way Packer executes the msiexec .. Here is my template provisioner section:

"provisioners": [
    {
      "type": "chef-solo",
      "cookbook_paths": ["/Users/mic//chef/cookbooks"],
      "data_bags_path": "/Users/mic/chef/data_bags",
      "encrypted_data_bag_secret_path": "/Users/mic/.chef/encrypted_data_bag_secret",
      "install_command": "echo \"\n\" | powershell -Command \"(New-Object System.Net.WebClient).DownloadFile('http://www.getchef.com/chef/install.msi', 'C:\\Windows\\Temp\\chef.msi’)\" ; cmd /c 'msiexec /qb /i C:\\Windows\\Temp\\chef.msi'",
      "execute_command": "c:/opscode/chef/bin/chef-solo --no-color -c {{.ConfigPath}} -j {{.JsonPath}}",
      "staging_directory": "c:/windows/temp",
      "run_list": ["recipe[base]"]
    }
  ]

bigmyx avatar Mar 17 '16 16:03 bigmyx