Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ else
endif
# Packer does not allow empty variables, so only pass variables that are defined
PACKER_VARS := -var 'cm=$(CM)' -var 'version=$(BOX_VERSION)' -var 'update=$(UPDATE)' -var 'headless=$(HEADLESS)' -var "shutdown_command=$(SHUTDOWN_COMMAND)"
ifdef CM_OPTIONS
PACKER_VARS += -var 'cm_options=$(CM_OPTIONS)'
endif
ifdef CM_VERSION
PACKER_VARS += -var 'cm_version=$(CM_VERSION)'
endif
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,15 @@ Possible values for the CM variable are:
* `puppet` - Install Puppet
* `salt` - Install Salt

You can also specify a variable `CM_VERSION`, if supported by the
configuration management tool, to override the default of `latest`.
You can also specify a variable `CM_VERSION` for all configuration management
tools except Salt, to override the default of `latest`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the comment in the review for script/cmtool.bat. I think we might be able to still preserve the functionality of allowing the user to set the salt version via CM_VERSION.

The value of `CM_VERSION` should have the form `x.y` or `x.y.z`,
such as `CM_VERSION := 11.12.4`

For Salt you can specify a variable `CM_OPTIONS`. This variable will be passed
to Salt bootstrap script. For information on possible values please read:
https://github.com/saltstack/salt-bootstrap/blob/stable/bootstrap-salt.ps1

Another use for `Makefile.local` is to override the default locations
for the Windows install ISO files.

Expand Down
1 change: 1 addition & 0 deletions eval-win10x64-enterprise-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win10x64-enterprise-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win10x64-enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win10x86-enterprise-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win10x86-enterprise-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win10x86-enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2008r2-datacenter-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2008r2-datacenter-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2008r2-datacenter.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2008r2-standard-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2008r2-standard-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2008r2-standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2012r2-datacenter-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2012r2-datacenter-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2012r2-datacenter.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2012r2-standard-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2012r2-standard-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2012r2-standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2016-standard-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2016-standard-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win2016-standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win7x64-enterprise-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win7x64-enterprise-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win7x64-enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win7x86-enterprise-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win7x86-enterprise-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win7x86-enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win81x64-enterprise-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win81x64-enterprise-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win81x64-enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win81x86-enterprise-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win81x86-enterprise-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions eval-win81x86-enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
31 changes: 6 additions & 25 deletions script/cmtool.bat
Original file line number Diff line number Diff line change
Expand Up @@ -139,39 +139,20 @@ goto exit0
:salt
::::::::::::

if "%CM_VERSION%" == "latest" set CM_VERSION=2015.8.8-2

if not defined SALT_64_URL set SALT_64_URL=https://repo.saltstack.com/windows/Salt-Minion-%CM_VERSION%-AMD64-Setup.exe
if not defined SALT_32_URL set SALT_32_URL=https://repo.saltstack.com/windows/Salt-Minion-%CM_VERSION%-x86-Setup.exe

if defined ProgramFiles(x86) (
set SALT_URL=%SALT_64_URL%
) else (
set SALT_URL=%SALT_32_URL%
)

for %%i in ("%SALT_URL%") do set SALT_EXE=%%~nxi
set SALT_DIR=%TEMP%\salt
set SALT_PATH=%SALT_DIR%\%SALT_EXE%

echo ==^> Creating "%SALT_DIR%"
mkdir "%SALT_DIR%"
pushd "%SALT_DIR%"

if exist "%SystemRoot%\_download.cmd" (
call "%SystemRoot%\_download.cmd" "%SALT_URL%" "%SALT_PATH%"
) else (
echo ==^> Downloading %SALT_URL% to %SALT_PATH%
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%SALT_URL%', '%SALT_PATH%')" <NUL
)
set SALT_URL=https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.ps1
set SALT_PATH=%SALT_DIR%\bootstrap-salt.ps1
echo ==^> Downloading %SALT_URL% to %SALT_PATH%
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%SALT_URL%', '%SALT_PATH%')" <NUL

if not exist "%SALT_PATH%" goto exit1

echo ==^> Installing Salt minion
:: see http://docs.saltstack.com/en/latest/topics/installation/windows.html
"%SALT_PATH%" /S %SALT_OPTIONS%

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: "%SALT_PATH%" /S %SALT_OPTIONS%
ver>nul
powershell "%SALT_PATH%" %CM_OPTIONS%

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we include the -version parameter here wth %CM_VERSION% so that we still expose that capability (to choose version) to users?

I think to avoid needing a conditional for the case of an undefined CM_VERSION, we can use "Latest" but I'll leave that up to you on whether or not you want to use a conditional for calling bootstrap-salt with an undefined CM_VERSION, or a conditional to set CM_VERSION to Latest if it's undefined.


goto exit0

Expand Down
1 change: 1 addition & 0 deletions win2008r2-datacenter-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions win2008r2-datacenter-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions win2008r2-datacenter.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions win2008r2-enterprise-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions win2008r2-enterprise-ssh.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions win2008r2-enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
1 change: 1 addition & 0 deletions win2008r2-standard-cygwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
{
"environment_vars": [
"CM={{user `cm`}}",
"CM_OPTIONS={{user `cm_options`}}",
"CM_VERSION={{user `cm_version`}}",
"UPDATE={{user `update`}}"
],
Expand Down
Loading