I do admit it - I'm a Linux SysAd with zero Windows administration so I thought Chef was gonna make it easier for me. Boy, was I wrong :-)
Here's the thing. I'm trying to bootstrap Chef on Windows 2008r2 machine which has cygwin/ssh installed - so the bootstrap I'm trying is naturally via ssh.
Now, after fixing some knife-windows bugs locally by crazy troubleshooting I came to the point where somehow the powershell script to which the Chef download falls through fails with an unidentifiable error :-)
Here are the details:
knifep bootstrap windows ssh SERVER.AWS.COM -N wintest -x Administrator --environment "dev" --bootstrap-version 11.6.2
...
....
SERVER.AWS.COM C:\cygwin\home\Administrator>cscript /nologo C:\chef\wget.vbs /url:"https://www.opscode.com/chef/download?p=windows&pv=2008r2&m=x86_64&v=11.6.2" /path:"C:\cygwin\tmp\chef-client-latest.msi"
SERVER.AWS.COM C:\chef\wget.vbs(31, 1) (null): The specified module could not be found.
SERVER.AWS.COM
SERVER.AWS.COM Failed download: download completed, but downloaded file not found
SERVER.AWS.COM Warning: Failed to download "https://www.opscode.com/chef/download?p=windows&pv=2008r2&m=x86_64&v=11.6.2" to "C:\cygwin\tmp\chef-client-latest.msi"
SERVER.AWS.COM Warning: Retrying download with PowerShell if available...
SERVER.AWS.COM !powershell_download!
SERVER.AWS.COM Downloaded: "https://www.opscode.com/chef/download?p=windows&pv=2008r2&m=x86_64&v=11.6.2&DownloadContext=PowerShell" "C:\cygwin\tmp\chef-client-latest.msi"
SERVER.AWS.COM Download via PowerShell succeeded.
SERVER.AWS.COM Installing downloaded client package...
SERVER.AWS.COM
SERVER.AWS.COM C:\cygwin\home\Administrator>msiexec /qn /log "C:\cygwin\tmp\chef-client-msi4840.log" /i "C:\cygwin\tmp\chef-client-latest.msi"
SERVER.AWS.COM This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.
Chef-client package failed to install with status code !ERRORLEVEL!.
SERVER.AWS.COM See installation log for additional detail: C:\cygwin\tmp\chef-client-msi4840.log.
Now, I'm like ..cool, let's have a look at the log file to see what went wrong! Here it is :-)
milosgajdos@magnolia ~ $ ssh [email protected]
Last login: Thu May 22 17:02:50 2014 from 82.211.87.195
Administrator@ip-0A3AA70D ~
$ ls -ltr /tmp/
total 32
-rw-r--r-- 1 Admin None 393 May 22 16:49 root.key
-rw-r--r-- 1 Admin None 2606 May 22 16:50 keys.tmp
-rw-r--r-- 1 Admin None 387 May 22 16:50 updatekeys.log
-rwxr-xr-x 1 Administrator None 9813 May 22 16:58 bootstrap-13677-1400777903.bat
-rwxr-xr-x 1 Administrator None 2 May 22 16:59 chef-client-msi4020.log
-rwxr-xr-x 1 Administrator None 9810 May 22 17:02 bootstrap-13718-1400778159.bat
-rwxr-xr-x 1 Administrator None 2 May 22 17:02 chef-client-msi4840.log
drwxrwxrwx+ 1 Admin None 0 May 22 17:07 sudo
Administrator@ip-0A3AA70D ~
$ cat /tmp/chef-client-msi4840.log
��
Administrator@ip-0A3AA70D ~
$
Errrrr, w000000t ?!
Right, after hours of frustration I decide to do this manually via remote desktop. I install the chef omnibus package and test if chef-client is installed and get RBconfig error:
Administrator@ip-0A3AA70D /cygdrive/c
$ sudo chef-client -v
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/windows-api-0.4.0/lib/windows/api.rb:4: Use RbConfig instead of obsolete and deprecated Config.
Chef: 11.6.2
After this I give up and try to get the node registered by ignoring the above warning. It does succeed.
Anyone knows why the download bootstrap script says it did succeed when it did NOT and caused the bootstrap to fail completely ? Thanks!