fix: ansible 2.19: calico: felix config final evaluation (#13496)

This commit is contained in:
Max Gautier
2026-09-10 13:48:36 +00:00
committed by GitHub
parent 16ad6da94e
commit 3437dde4b9
+21 -30
View File
@@ -154,39 +154,30 @@
ignore_errors: true ignore_errors: true
changed_when: false changed_when: false
- name: Calico | Set kubespray FelixConfiguration
set_fact:
_felix_config: >
{
"kind": "FelixConfiguration",
"apiVersion": "projectcalico.org/v3",
"metadata": {
"name": "default",
},
"spec": {
"ipipEnabled": {{ calico_ipip_mode != 'Never' }},
"reportingInterval": "{{ calico_felix_reporting_interval }}",
"bpfLogLevel": "{{ calico_bpf_log_level }}",
"bpfEnabled": {{ calico_bpf_enabled | bool }},
"bpfExternalServiceMode": "{{ calico_bpf_service_mode }}",
"wireguardEnabled": {{ calico_wireguard_enabled | bool }},
"logSeverityScreen": "{{ calico_felix_log_severity_screen }}",
"vxlanEnabled": {{ calico_vxlan_mode != 'Never' }},
"featureDetectOverride": "{{ calico_feature_detect_override }}",
"floatingIPs": "{{ calico_felix_floating_ips }}"
}
}
- name: Calico | Process FelixConfiguration
set_fact:
_felix_config: "{{ _felix_cmd.stdout | from_json | combine(_felix_config, recursive=True) }}"
when:
- _felix_cmd is success
- name: Calico | Configure calico FelixConfiguration - name: Calico | Configure calico FelixConfiguration
vars:
_felix_config_defaults:
kind: "FelixConfiguration"
apiVersion: "projectcalico.org/v3"
metadata:
name: "default"
spec:
ipipEnabled: "{{ calico_ipip_mode != 'Never' }}"
reportingInterval: "{{ calico_felix_reporting_interval }}"
bpfLogLevel: "{{ calico_bpf_log_level }}"
bpfEnabled: "{{ calico_bpf_enabled | bool }}"
bpfExternalServiceMode: "{{ calico_bpf_service_mode }}"
wireguardEnabled: "{{ calico_wireguard_enabled | bool }}"
logSeverityScreen: "{{ calico_felix_log_severity_screen }}"
vxlanEnabled: "{{ calico_vxlan_mode != 'Never' }}"
featureDetectOverride: "{{ calico_feature_detect_override }}"
floatingIPs: "{{ calico_felix_floating_ips }}"
command: command:
cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" cmd: "{{ bin_dir }}/calicoctl.sh apply -f -"
stdin: "{{ _felix_config is string | ternary(_felix_config, _felix_config | to_json) }}" stdin: "{{ ((_felix_cmd.stdout | from_json
if _felix_cmd is success
else {}) | combine(_felix_config_defaults, recursive=True))
| to_json }}"
changed_when: false changed_when: false
- name: Calico | Configure Calico IP Pool - name: Calico | Configure Calico IP Pool