Skip to content

Instantly share code, notes, and snippets.

@Spankalish
Created March 29, 2016 19:49
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/398cb86573140054df3fddfea8f1c16f to your computer and use it in GitHub Desktop.
Save Spankalish/398cb86573140054df3fddfea8f1c16f to your computer and use it in GitHub Desktop.
reactor.conf, in master.d---
reactor:
- salt/states/base/nginx:
- /srv/salt/reactor/stop.sls
event on web server---
disable_server_in_LB:
event:
- wait
- name: salt/states/base/nginx
- data:
id: {{ salt['grains.get']('host') }}
- watch:
- service: nginx
/srv/salt/reactor/stop.sls---
disable server in haproxy:
local.cmd.run:
- name: disable server in LB
- tgt: 'LB'
- arg:
- echo "disable server here/%s | socat stdio /etc/haproxy/haproxysock"|format(data['id'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment