boxcutter / windows

Virtual machine templates for Windows written in legacy JSON and Batch Scripting/JScript
Apache License 2.0
753 stars 266 forks source link

Updated the chef installer in script/cmtool.bat to use "latest" to constrain to the latest non-licensed (free) version, and "licensed" to use the latest licensed (non-free) version #211

Closed arizvisa closed 4 years ago

arizvisa commented 4 years ago

By default here, setting CM_VERSION to latest will result in querying omnitruck for the most recent free version of chef. Setting CM_VERSION to licensed will result in querying omnitruck for the most recent licensed version of chef.

Do not merge this as-is as this will need to be documented, tested, and likely cleaned up a little.

arizvisa commented 4 years ago

This PR is based on #202, and after a lengthy discussion this methodology of constraining the chef version was more acceptable by the original submitter. This PR still needs to be documented and double-checked. I'll try and work on this tonight but might end up finishing it sometime tomorrows.

arizvisa commented 4 years ago

Okay, now to do some tests. This is the fun part...

arizvisa commented 4 years ago

I just tried to re-base this on top of a revert of #202 so that we can preserve history, but all of the template changes made it super tedious. Pretty disappointed to discard the original author's ideas. :-/

arizvisa commented 4 years ago

Ok. Busted. Can't put comments at the end of conditionals in script/cmtool.bat.

arizvisa commented 4 years ago

Ok. Apparently this wasn't re-based onto master.. force-pushed due to rebase.

arizvisa commented 4 years ago

Okay, here's from eval-win7x64-enterprise-ssh.json using a CM_VERSION set to "latest":

==> vmware-iso: Provisioning with shell script: C:\Users\user\work\lolmeter\build\boxcutter-windows/script/cmtool.bat
    vmware-iso: ==> Detected Windows Platform Version: 6.1
    vmware-iso: ==> User has chosen the most recent free version of chef
    vmware-iso: ==> Getting chef 14.14.29 x64 download URL
    vmware-iso: "==> Using Chef Omnitruck API URL: "https://omnitruck.chef.io/stable/chef/metadata?p=windows&m=x64&v=14.14.29""
    vmware-iso: "==> Got chef download URL: https://packages.chef.io/files/stable/chef/14.14.29/windows/2019/chef-client-14.14.29-1-x64.msi"
    vmware-iso: ==> Creating "C:\Users\vagrant\AppData\Local\Temp\chef"
    vmware-iso: ==> Downloading "https://packages.chef.io/files/stable/chef/14.14.29/windows/2019/chef-client-14.14.29-1-x64.msi" to "C:\Users\vagrant\AppData\Local\Temp\chef\chef-client-14.14.29-1-x64.msi"
    vmware-iso: ==> Installing chef latest
    vmware-iso:
    vmware-iso: Pinging 127.0.0.1 with 32 bytes of data:
    vmware-iso: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    vmware-iso: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    vmware-iso: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    vmware-iso: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    vmware-iso:
    vmware-iso: Ping statistics for 127.0.0.1:
    vmware-iso:     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    vmware-iso: Approximate round trip times in milli-seconds:
    vmware-iso:     Minimum = 0ms, Maximum = 0ms, Average = 0ms
    vmware-iso: ==> Script exiting with errorlevel 0
arizvisa commented 4 years ago

Now from eval-win7x64-enterprise.json using a CM_VERSION set to "licensed".

==> vmware-iso: Provisioning with shell script: C:\Users\user\work\lolmeter\build\boxcutter-windows/script/cmtool.bat
    vmware-iso: ==> Detected Windows Platform Version: 6.1
    vmware-iso: ==> User has chosen the most recent licensed version of chef
    vmware-iso: ==> Getting chef latest x64 download URL
    vmware-iso: "==> Using Chef Omnitruck API URL: "https://omnitruck.chef.io/stable/chef/metadata?p=windows&m=x64&v=latest""
    vmware-iso: "==> Got chef download URL: https://packages.chef.io/files/stable/chef/15.6.10/windows/2019/chef-client-15.6.10-1-x64.msi"
    vmware-iso: ==> Creating "C:\Users\vagrant\AppData\Local\Temp\chef"
    vmware-iso: ==> Downloading "https://packages.chef.io/files/stable/chef/15.6.10/windows/2019/chef-client-15.6.10-1-x64.msi" to "C:\Users\vagrant\AppData\Local\Temp\chef\chef-client-15.6.10-1-x64.msi"
    vmware-iso: ==> Installing chef licensed
    vmware-iso:
    vmware-iso: Pinging 127.0.0.1 with 32 bytes of data:
    vmware-iso: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    vmware-iso: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    vmware-iso: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    vmware-iso: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    vmware-iso:
    vmware-iso: Ping statistics for 127.0.0.1:
    vmware-iso:     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    vmware-iso: Approximate round trip times in milli-seconds:
    vmware-iso:     Minimum = 0ms, Maximum = 0ms, Average = 0ms
    vmware-iso: ==> Script exiting with errorlevel 0
arizvisa commented 4 years ago

Okay, and how for the eval-win7x86-enterprise.json template using CM_VERSION set to 15.4.45...

==> vmware-iso: Provisioning with shell script: C:\Users\user\work\lolmeter\build\boxcutter-windows/script/cmtool.bat
    vmware-iso: ==> Detected Windows Platform Version: 6.1
    vmware-iso: ==> Getting chef 15.4.45 x86 download URL
    vmware-iso: ==> Using Chef Omnitruck API URL: "https://omnitruck.chef.io/stable/chef/metadata?p=windows&m=x86&v=15.4.45"
    vmware-iso: ==> Got chef download URL: https://packages.chef.io/files/stable/chef/15.4.45/windows/2012r2/chef-client-15.4.45-1-x86.msi0
    vmware-iso: ==> Creating "C:\Users\vagrant\AppData\Local\Temp\chef"
    vmware-iso: ==> Downloading "https://packages.chef.io/files/stable/chef/15.4.45/windows/2012r2/chef-client-15.4.45-1-x86.msi" to "C:\Users\vagrant\AppData\Local\Temp\chef\chef-client-15.4.45-1-x86.msi"
    vmware-iso: ==> Installing chef 15.4.45
    vmware-iso:
    vmware-iso: Pinging 127.0.0.1 with 32 bytes of data:
    vmware-iso: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    vmware-iso: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    vmware-iso: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    vmware-iso: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    vmware-iso:
    vmware-iso: Ping statistics for 127.0.0.1:
    vmware-iso:     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    vmware-iso: Approximate round trip times in milli-seconds:
    vmware-iso:     Minimum = 0ms, Maximum = 0ms, Average = 0ms
    vmware-iso: ==> Script exiting with errorlevel 0
arizvisa commented 4 years ago

Okay, think I finally got the title right.