Skip to content

Instantly share code, notes, and snippets.

@Spankalish
Last active March 30, 2016 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Spankalish/4a7bc706d559557339909e53e7d88c28 to your computer and use it in GitHub Desktop.
Save Spankalish/4a7bc706d559557339909e53e7d88c28 to your computer and use it in GitHub Desktop.
Master Terminal: Successful
sudo salt 'LB' cmd.run 'echo "disable server here/salt-minion1" | socat stdio /var/lib/haproxy/stats'
Master .sls file: Fail
disable server in haproxy:
- name: |
- tgt: 'LB'
echo "disable server here/salt-minion1" | socat stdio /var/lib/haproxy/stats
@UtahDave
Copy link

cat myexample.sls

disable server in haproxy:
  cmd.run:
    - name: 'echo "disable server here/salt-minion1" | socat stdio /var/lib/haproxy/stats'      

Then you'd run it like this:

salt 'LB' state.sls myexample

@UtahDave
Copy link

disable server in haproxy:
  local.cmd.run:
    - tgt: LB
    - arg: 
      - 'echo "disable server here/salt-minion1" | socat stdio /var/lib/haproxy/stats'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment