From 0e86f32b4b0ab866c8987b0b9ba5d8b5a53e1072 Mon Sep 17 00:00:00 2001 From: Ondra Machacek Date: Wed, 14 Mar 2018 16:16:05 +0100 Subject: [PATCH] Fix skipping when host fail to update Change-Id: I32d73bf37a891983e8c70e46bffa76b65ac345e0 Signed-off-by: Ondra Machacek --- tasks/main.yml | 11 +---------- tasks/upgrade.yml | 9 +++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 tasks/upgrade.yml diff --git a/tasks/main.yml b/tasks/main.yml index e325d47..ad72613 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -53,16 +53,7 @@ # Update only those hosts that aren't in list of hosts were VMs are pinned # or if stop_non_migratable_vms is enabled, which means we stop pinned VMs - - name: Upgrade host - # TODO: change to ovirt_hosts, when Ansible 2.6 is out: - ovirt_hosts_26: - auth: "{{ ovirt_auth }}" - name: "{{ item.name }}" - state: upgraded - check_upgrade: "{{ check_upgrade }}" - reboot_after_upgrade: "{{ reboot_after_upgrade }}" - timeout: "{{ upgrade_timeout }}" - register: host_upgraded + - include: upgrade.yml with_items: - "{{ ovirt_hosts }}" when: "item.id not in host_ids or stop_non_migratable_vms" diff --git a/tasks/upgrade.yml b/tasks/upgrade.yml new file mode 100644 index 0000000..621cf22 --- /dev/null +++ b/tasks/upgrade.yml @@ -0,0 +1,9 @@ +- name: Upgrade host + # TODO: change to ovirt_hosts, when Ansible 2.6 is out: + ovirt_hosts_26: + auth: "{{ ovirt_auth }}" + name: "{{ item.name }}" + state: upgraded + check_upgrade: "{{ check_upgrade }}" + reboot_after_upgrade: "{{ reboot_after_upgrade }}" + timeout: "{{ upgrade_timeout }}"