Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: all
- remote_user: root
- gather_facts: false
- tasks:
- - name: Login to oVirt
- ovirt_auth:
- url: "{{ engine_url }}"
- username: "{{ engine_user }}"
- password: "{{ engine_password }}"
- ca_file: "{{ engine_cafile | default(omit) }}"
- insecure: "{{ engine_insecure | default(true) }}"
- when: ovirt_auth is undefined
- register: loggedin
- tags:
- - always
- - name: Init failed_host_names and succeed_host_names list
- set_fact:
- failed_host_names: []
- succeed_host_names: []
- - include: ovirt-gluster-services.yml #Gluster service and geo-rep status
- - include: ovirt-gluster-checks.yml #Self heal and stopping gluster processes
- - include: cluster_upgrade.yml
- with_items:
- - "{{ ovirt_hosts }}"
- - include: ovirt-gluster-restart.yml
- when: ovirt_hosts | upgraded == True
- - name: Print info about host which was updated
- debug:
- msg: "Following hosts was successfully updated: {{ succeed_host_names }}"
- - name: Fail the playbook, if some hosts wasn't updated
- fail:
- msg: "The cluster upgrade failed. Hosts {{ failed_host_names }} wasn't updated."
- when: "failed_host_names | length > 0"
- - name: Logout from oVirt
- ovirt_auth:
- state: absent
- ovirt_auth: "{{ ovirt_auth }}"
- when: not loggedin.skipped | default(false)
- tags:
- - always
Add Comment
Please, Sign In to add comment