Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Command to remove host from LB
- remove_from_lb:
- cmd.wait:
- - name: /home/thjackso/tmp/rotation/oor.sh
- # Command to add host to LB
- add_to_lb:
- cmd.wait:
- - name: /home/thjackso/tmp/rotation/ir.sh
- haproxy:
- pkg:
- - latest
- - watch_in:
- - cmd: remove_from_lb
- service:
- - running
- - watch:
- - cmd: remove_from_lb
- - watch_in:
- - cmd: add_to_lb
- {% if grains['fqdn'] == 'HostA' %}
- /etc/haproxy/haproxy.cfg:
- file.managed:
- - source: http://localhost/test
- - user: thjackso
- - group: eng
- - mode: 644
- - source_hash: md5=026d7edc66fb6e5b2ce1ea6e4b2f7bb9
- {% if grains['fqdn'] == 'HostB' %}
- /etc/haproxy/haproxy.cfg:
- file.managed:
- - source: http://localhost/test2
- - user: thjackso
- - group: eng
- - mode: 644
- - source_hash: md5=e1911cdcd9bca71653b5fc5e5c03dc36
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement