From 26943dfdc85f74782aa414a9383b94da9a8ef916 Mon Sep 17 00:00:00 2001 From: darkobas Date: Sat, 17 Feb 2024 01:09:52 +0100 Subject: [PATCH] fix: skip multus when not defined fix task failure: TASK [kubernetes-apps/network_plugin/multus : Multus | Start resources] ************************************************ fatal: [hfal12k8n1 -> {{ groups['kube_control_plane'][0] }}]: FAILED! => {"msg": "Error in jmespath.search in json_query filter plugin:\n'ansible.vars.hostvars.HostVarsVars object' has no attribute 'multus_manifest_2'"} --- roles/kubernetes-apps/network_plugin/multus/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kubernetes-apps/network_plugin/multus/tasks/main.yml b/roles/kubernetes-apps/network_plugin/multus/tasks/main.yml index fdbede55ad5..54dd1ed6144 100644 --- a/roles/kubernetes-apps/network_plugin/multus/tasks/main.yml +++ b/roles/kubernetes-apps/network_plugin/multus/tasks/main.yml @@ -9,7 +9,7 @@ state: "latest" delegate_to: "{{ groups['kube_control_plane'][0] }}" run_once: true - with_items: "{{ multus_manifest_1.results + (multus_nodes_list | map('extract', hostvars, 'multus_manifest_2') | list | json_query('[].results')) }}" + with_items: "{{ (multus_manifest_1.results | default([])) + (multus_nodes_list | map('extract', hostvars, 'multus_manifest_2.results') | default([]) | list) }}" loop_control: label: "{{ item.item.name if item != None else 'skipped' }}" vars: