Haseeb A
Haseeb A

Reputation: 6152

how to run a shell script on remote using salt-ssh

my web server generates a shell script with more than 100 lines of code based on complex user selections. I need to orchestrate this over several machines using salt-ssh. what I need is to copy this shell script to remote and execute it from there for all devices. how to achieve this with salt-ssh ?. I can not install minions on the remote device.

Upvotes: 0

Views: 1939

Answers (1)

doz10us
doz10us

Reputation: 777

Just as with normal minion. Write a state...

add script:
    file.managed:
    - name: file.sh
    - source: /path/to/file.sh

run script:
    cmd.run:
    - name: file.sh

...and apply it

salt-ssh 'minions*' state.apply mystate.sls

Upvotes: 2

Related Questions