Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. remove lb1:
  2. file.blockreplace:
  3. - name: /tmp/loadbalancer.conf
  4. - marker_start: '< Load Balancer >'
  5. - marker_end: '</ Load Balancer>'
  6. - content: "10.10.10.200"
  7. - append_if_not_found: False
  8. - backup: '.bak'
  9.  
  10. test:
  11. cmd.run:
  12. - name: while [ "$LOADVALUE" -ne 0 ] ; do echo $LOADVALUE ; LOADVALUE=$((LOADVALUE-2)); done
  13. - env:
  14. - LOADVALUE: "30"
  15.  
  16.  
  17. add lb1:
  18. file.blockreplace:
  19. - name: /tmp/loadbalancer.conf
  20. - marker_start: '< Load Balancer >'
  21. - marker_end: '</ Load Balancer>'
  22. - content: "10.10.10.100"
  23. - append_if_not_found: False
  24. - backup: '.bak'
  25. - onchanges:
  26. - cmd: test
  27.  
  28.  
  29. Restore file to orig - Balance Check failed to return - :
  30. file.managed:
  31. - name: /tmp/loadbalancer.conf
  32. - user: root
  33. - group: wheel
  34. - mode: 0644
  35. - source: salt://apache/lb/files/loadbalancer.conf
  36. - template: jinja
  37. - onfail:
  38. - cmd: test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement