3

I'm trying to download uru from bitbucket and try to install using vagrant with default login credentials. I'm able to download the archive. When ever I try to run the script see this error - Invalidly-formated env parameter. See documentation. I'm able to run the script without any errors. I'm running this locally using vagrant in masterless mode. Any help is really appreciated.

download_uru:
  file.managed:
    - name: c:\uru-0.8.3-windows-x86.7z
    - source: https://bitbucket.org/jonforums/uru/downloads/uru-0.8.3-windows-x86.7z
    - source_hash: sha256=f2a7b4ed8ef6b02613b134da19a31293c7423e8fbbd8e49ec5c1c86c5f3a0815

install_uru:
  cmd.run:
    - source: salt://ruby/files/install_uru.ps1
    - shell: powershell
    - env: "-ExecutionPolicy bypass"
    - runas: "vagrant"
    - password: "vagrant"
    - require:
      - file: download_uru

$cat install_uru.ps1

set-alias sz "$env:ProgramFiles\7-Zip\7z.exe"

sz x -oC: C:\uru-0.8.3-windows-x86.7z -r ;

c:\salt\salt-call.bat --version

salt-call 2016.11.3 (Carbon)

1

2 Answers 2

3

Your problem is due to the wrong format of the -env parameter. As described in the official documentation it must be a list and you are setting a string.

Fix the install_uru state like the code below and it will run correctly.

install_uru:
  cmd.run:
    - source: salt://ruby/install_uru.ps1
    - shell: powershell
    - env: 
      - ExecutionPolicy: "bypass"
    - runas: "vagrant"
    - password: "vagrant"
    - require:
      - file: download_uru
Sign up to request clarification or add additional context in comments.

2 Comments

You're welcome @user6136315. If the answer solved your problem please mark it as the right solution.
as of today one has to use the state function "cmd.script" instead of "cmd.run" with the parameter "source" (docs.saltstack.com/en/latest/ref/states/all/…)
1

This is also working.

download_uru:
  file.managed:
    - name: c:\uru-0.8.3-windows-x86.7z
    - source: https://bitbucket.org/jonforums/uru/downloads/uru-0.8.3-windows-x86.7z
    - source_hash: sha256=f2a7b4ed8ef6b02613b134da19a31293c7423e8fbbd8e49ec5c1c86c5f3a0815

salt://ruby/files/install_uru.ps1:
  cmd.script:
    - shell: powershell
    - env:
      - ExecutionPolicy: "bypass"
    - cwd: C:\

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.