Guest User

Untitled

a guest
Nov 22nd, 2017
865
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. ---
  2. - hosts: all
  3. remote_user: root
  4. gather_facts: false
  5.  
  6. tasks:
  7. - name: Login to oVirt
  8. ovirt_auth:
  9. url: "{{ engine_url }}"
  10. username: "{{ engine_user }}"
  11. password: "{{ engine_password }}"
  12. ca_file: "{{ engine_cafile | default(omit) }}"
  13. insecure: "{{ engine_insecure | default(true) }}"
  14. when: ovirt_auth is undefined
  15. register: loggedin
  16. tags:
  17. - always
  18.  
  19. - name: Init failed_host_names and succeed_host_names list
  20. set_fact:
  21. failed_host_names: []
  22. succeed_host_names: []
  23.  
  24. - include: ovirt-gluster-services.yml #Gluster service and geo-rep status
  25. - include: ovirt-gluster-checks.yml #Self heal and stopping gluster processes
  26. - include: cluster_upgrade.yml
  27. with_items:
  28. - "{{ ovirt_hosts }}"
  29.  
  30. - include: ovirt-gluster-restart.yml
  31. when: ovirt_hosts | upgraded == True
  32.  
  33. - name: Print info about host which was updated
  34. debug:
  35. msg: "Following hosts was successfully updated: {{ succeed_host_names }}"
  36.  
  37. - name: Fail the playbook, if some hosts wasn't updated
  38. fail:
  39. msg: "The cluster upgrade failed. Hosts {{ failed_host_names }} wasn't updated."
  40. when: "failed_host_names | length > 0"
  41.  
  42. - name: Logout from oVirt
  43. ovirt_auth:
  44. state: absent
  45. ovirt_auth: "{{ ovirt_auth }}"
  46. when: not loggedin.skipped | default(false)
  47. tags:
  48. - always
Add Comment
Please, Sign In to add comment