From ab72a180e687a209b1b48deebd0c37b6ebca042c Mon Sep 17 00:00:00 2001 From: Damian Dabrowski Date: Mon, 6 Nov 2023 19:43:03 +0100 Subject: [PATCH] Avoid failures when default libvirt network does not exist This is a follow-up change to [1]. Depending on operating system and environment configuration, default libvirt network may not exist. Right now, `Check for libvirt default network` task throws an error in this case causing nova playbook to fail. This change fixes that by instructing ansible to not throw an error if `virsh net-list` fails with "Network not found: no network with matching name" because it is acceptable to not have this network. [1] https://review.opendev.org/c/openstack/openstack-ansible-os_nova/+/899768 Change-Id: If692bc94f421bc84ad9e6d43f548b68196a9e751 --- tasks/drivers/kvm/nova_compute_kvm_virsh_net_remove.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/drivers/kvm/nova_compute_kvm_virsh_net_remove.yml b/tasks/drivers/kvm/nova_compute_kvm_virsh_net_remove.yml index 1447435a..e49a7e1b 100644 --- a/tasks/drivers/kvm/nova_compute_kvm_virsh_net_remove.yml +++ b/tasks/drivers/kvm/nova_compute_kvm_virsh_net_remove.yml @@ -16,6 +16,7 @@ - name: Get information about libvirt default network command: "virsh net-info default" changed_when: false + failed_when: (default_net_info.rc != 0) and ('Network not found' not in default_net_info.stderr) register: default_net_info - name: Disable libvirt default network # noqa: no-changed-when