Advertisement
jacksontj

Untitled

Jun 13th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. # Command to remove host from LB
  2. remove_from_lb:
  3. cmd.wait:
  4. - name: /home/thjackso/tmp/rotation/oor.sh
  5.  
  6. # Command to add host to LB
  7. add_to_lb:
  8. cmd.wait:
  9. - name: /home/thjackso/tmp/rotation/ir.sh
  10.  
  11.  
  12.  
  13. haproxy:
  14. pkg:
  15. - latest
  16. - watch_in:
  17. - cmd: remove_from_lb
  18. service:
  19. - running
  20. - watch:
  21. - cmd: remove_from_lb
  22. - watch_in:
  23. - cmd: add_to_lb
  24.  
  25. {% if grains['fqdn'] == 'HostA' %}
  26. /etc/haproxy/haproxy.cfg:
  27. file.managed:
  28. - source: http://localhost/test
  29. - user: thjackso
  30. - group: eng
  31. - mode: 644
  32. - source_hash: md5=026d7edc66fb6e5b2ce1ea6e4b2f7bb9
  33.  
  34. {% if grains['fqdn'] == 'HostB' %}
  35. /etc/haproxy/haproxy.cfg:
  36. file.managed:
  37. - source: http://localhost/test2
  38. - user: thjackso
  39. - group: eng
  40. - mode: 644
  41. - source_hash: md5=e1911cdcd9bca71653b5fc5e5c03dc36
  42. {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement