Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. tasks:
  2. - block:
  3. - name: Start indexing of pdh
  4. local_action:
  5. module: uri
  6. method: POST
  7. user: "{{ scheduler.pdh.credentials.refresh.username }}"
  8. password: "{{ scheduler.pdh.credentials.refresh.password }}"
  9. url: "http://{{ ansible_fqdn }}:8080/pdh/admin/cache/refresh"
  10. become: no
  11.  
  12. - name: Health check
  13. local_action:
  14. module: uri
  15. method: GET
  16. user: "{{ scheduler.pdh.credentials.dashboard.username }}"
  17. password: "{{ scheduler.pdh.credentials.dashboard.password }}"
  18. url: "http://{{ ansible_fqdn }}:8080/pdh/healthcheck/dashboard.json"
  19. return_content: yes
  20. register: health_check
  21. until: ((health_check.content|from_json)['cache_update_status_description']|search('EDT successfully')) and ((health_check.content|from_json)['cache_update_status'] == "ok")
  22. # Wait for an hour
  23. retries: 120
  24. delay: 5
  25. become: no
  26. rescue:
  27. - name: Start indexing of pdh
  28. local_action:
  29. module: uri
  30. method: POST
  31. user: "{{ scheduler.pdh.credentials.refresh.username }}"
  32. password: "{{ scheduler.pdh.credentials.refresh.password }}"
  33. url: "http://{{ ansible_fqdn }}:8080/pdh/admin/cache/refresh"
  34. become: no
  35. always:
  36. - name: Show health check message
  37. debug: msg={{ (health_check.content|from_json) }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement