Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

salt provisioning fails if a version is specified when bootstraping windows instances #298

Open
muddman opened this issue Dec 11, 2019 · 0 comments
Assignees

Comments

@muddman
Copy link

muddman commented Dec 11, 2019

If you specify a version with salt_version when installing on a windows instance, the minion installation fails because bootstrap_options are set to config[:salt_bootstrap_options] = "-P git v#{salt_version}" and, -P is not a valid command line option to the bootstrap-salt.ps1 powershell script.

provisioner:
  name: salt_solo
  salt_install: bootstrap
  salt_version: 2019.2.2
-----> Starting Kitchen (v1.23.2)
-----> Converging <default-windows-2016>...
       Preparing files for transfer
       Preparing salt-minion
       Preparing pillars into /srv/pillar
       Preparing state collection
       Preparing state_top
       Preparing scripts into /etc/salt/scripts
           Directory: C:\
       Mode                LastWriteTime         Length Name
       ----                -------------         ------ ----
       d-----       12/11/2019   8:23 AM                temp
       No salt-minion installed, install must have failed!!
       salt_install = bootstrap
       salt_url = https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.ps1
       bootstrap_options = -P git v2019.2.2
...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Converge failed on instance <default-windows-2016>.  Please see .kitchen/logs/default-windows-2016.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

The code is on line 140 of kitchen-salt/lib/kitchen/provisioner/salt_solo.rb.

def setup_salt
        debug(diagnose)
        salt_version = config[:salt_version]

        # if salt_verison is set, bootstrap is being used & bootstrap_options is empty,
        # set the bootstrap_options string to git install the requested version
        if (salt_version != 'latest') && (config[:salt_install] == 'bootstrap') && config[:salt_bootstrap_options].empty?
          debug("Using bootstrap git to install #{salt_version}")
          config[:salt_bootstrap_options] = "-P git v#{salt_version}"
        end

The workaround is to specific the bootstrap_options:

provisioner:
  name: salt_solo
  salt_install: bootstrap
  salt_bootstrap_options: '-version 2019.2.2'
  salt_version: latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants