salt icon indicating copy to clipboard operation
salt copied to clipboard

cmd.script not using env list from sls

Open jessecollier opened this issue 12 years ago • 5 comments

Perhaps I am doing something wrong... but cannot figure out what it is. I am using the example given in the docs

scripts/foo.sh

echo "BATCH is: $BATCH"

test.sls

salt://scripts/foo.sh:
  cmd.script:
    - env:
      - BATCH: 'yes'
$ sudo salt-call state.sls test 
local:
----------
    State: - cmd
    Name:      salt://scripts/foo.sh
    Function:  script
        Result:    True
        Comment:   Command "salt://scripts/foo.sh" run
        Changes:   pid: 11899
                   retcode: 0
                   stderr: 
                   stdout: BATCH is:


Summary
------------
Succeeded: 1
Failed:    0
------------
Total:     1

edit:

$ salt-call --version
salt-call 0.17.5

jessecollier avatar May 21 '14 21:05 jessecollier

That version is a little old.... actually too old... Can't upgrade to a more recent one?

s0undt3ch avatar May 21 '14 21:05 s0undt3ch

That's what I thought. But the version is what is provided using ubuntu's universe repo for Trusty.

jessecollier avatar May 21 '14 22:05 jessecollier

Would using Salt's PPA be an option?

s0undt3ch avatar May 21 '14 22:05 s0undt3ch

Sorry should have updated this.

I ended up just installing the salt-minion via cloud-init to whatever version it can find, then I use salt to install the PPA and upgrade it as the first step. Solves my problem.

jessecollier avatar May 27 '14 20:05 jessecollier

Also, might want to add to documentation a minimum version for this to work perhaps.

jessecollier avatar May 27 '14 20:05 jessecollier