Updates Kuberef to use BMRA v21.08
[kuberef.git] / sw_config / bmra / patched_preflight.yml
1 # SPDX-FileCopyrightText: 2021 Intel Corporation.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 ---
6 # Preflight: ALL checks must PASS
7 # Only assert issues (do NOT change anything)
8 #
9 # Manual run: 'ansible-playbook -i inventory.ini playbooks/preflight.yml --flush-cache'
10 #
11 # Summary:
12 # On Ansible Host (localhost):
13 # - Check Ansible version (match)
14 # - Check Python version (min)
15 # - Check Group Vars (exist)
16 # - Check CMK Hosts (valid targets)
17 # On All targets (k8s-cluster):
18 # - Check Linux Distro
19 # - Check Hostnames (match Inventory)
20 # - Check CMK Config (isolcpus defined)
21 # - Check isolcpus Total (not more than actual)
22 # - Check isolcpus IDs (valid on system)
23 # - Check isolcpus OS Reserved (not 0,1,etc)
24 # On Worker Nodes Only (kube-node):
25 # - Check DP Interfaces (is not empty)
26 # - Check DP Interfaces Name (optional)
27 # - Check DP Interfaces Bus Info (pciid)
28 # - Check QAT Devices Bus Info (pciid)
29 # - Check QAT SRIOV VFs (max)
30 # - Check SGX configuration
31 # - Check OVS DPDK Dependencies (for 1G Hugepages)
32 # - Check VPP Dependencies (for 2M Hugepages)
33 # - Check CNI Dependencies (for OVS DPDK or VPP and Hugepages)
34 # - Check SST (not on RHEL 8.2 or old OSs)
35 # - Warn BIOS VT-d (should be enabled)
36 # - Warn BIOS Hyper-Threading (should be enabled)
37 # - Warn collectd (kernel update needed on old OSs)
38 # - Check OVS DPDK Version Compatability (for OVS support)
39
40 # additional vars required:
41 #  bmra_supported_ansible: # must be version
42 #  bmra_supported_python: # min version
43 #  bmra_supported_distros: [] # list
44 #  bmra_supported_distros_versions: [] # list
45
46
47 ##################################
48 # Prerequisites for Ansible Host #
49 ##################################
50 - hosts: 127.0.0.1
51   connection: local
52   vars:
53     bmra_supported_ansible: 2.9.20
54     bmra_supported_python: 2.7
55
56   tasks:
57
58     - debug: msg="Ansible version is {{ ansible_version.string }}"
59     - name: Check Ansible Version
60       assert:
61         that: (ansible_version.full is version_compare(bmra_supported_ansible, '=='))
62         msg: "Ansible version must be {{ bmra_supported_ansible }}. Please update"
63
64     - debug: msg="Python version is {{ ansible_python_version }}"
65     - name: Check Python Version
66       assert:
67         that: (ansible_python_version is version_compare(bmra_supported_python, '>='))
68         msg: "Python version must be at least {{ bmra_supported_python }}. Please update"
69
70     - name: Read Group Vars
71       stat:
72         path: "{{ inventory_dir }}/group_vars/"
73       register: group_vars_details
74
75     - name: Check Group Vars
76       assert:
77         that: "group_vars_details.stat.exists and group_vars_details.stat.isdir"
78         msg: "File group_vars/all.yml does NOT exist. Must be created per Guide"
79
80     - debug:
81         msg:
82           - cmk_enabled = {{ cmk_enabled }} (group_vars/all.yml)
83           - cmk_use_all_hosts = {{ cmk_use_all_hosts }} (group_vars/all.yml)
84           - cmk_hosts_list = {{ cmk_hosts_list | default('') }} (group_vars/all.yml)
85           - all targets = {{ groups['all'] }} (inventory.ini)
86       when: cmk_enabled is defined  # CMK expected true for all profiles except basic
87
88     - name: Check Intel CMK Hosts
89       assert:
90         that: "item in groups['all']"
91         msg: "Hostname '{{ item }}' is NOT a valid target from inventory.  Please correct the cmk_hosts_list or disable the CMK feature in group vars"
92       with_items: "{{ (cmk_hosts_list.split(',') if (cmk_hosts_list is defined and cmk_hosts_list | length > 0) else []) }}"
93       when: cmk_enabled is defined and cmk_enabled and not cmk_use_all_hosts
94
95
96 ##############################################
97 # Prerequisites for Control and Worker Nodes #
98 ##############################################
99 - hosts: k8s-cluster
100   vars:
101     bmra_supported_distros: [CentOS, RedHat, Ubuntu]
102     bmra_supported_distros_versions: ['7.6', '7.8', '7.9', '8.2', '8.3', '8.4', '18.04', '20.04', '21.04']
103     isolcpus_ranges: []
104     isolcpus_discretes: []
105
106   tasks:
107
108     - debug: msg="Linux distribution on target is {{ ansible_distribution }} {{ ansible_distribution_version }} {{ ansible_distribution_release }}"
109     - name: Check Linux Distro and Version
110       assert:
111         that: "ansible_distribution in bmra_supported_distros and ansible_distribution_version in bmra_supported_distros_versions"
112         msg:
113           - Linux distribution {{ ansible_distribution }} {{ ansible_distribution_version }} on target '{{ inventory_hostname }}' is NOT supported
114           - Must be one of {{ bmra_supported_distros }} and version {{ bmra_supported_distros_versions }}
115
116 #    - name: Check Linux Across Cluster
117 # TODO ?? Linux OS must be the same on all targets (no mix-n-match)
118
119     - name: regather network facts in case hostname recently changed
120       setup:
121         gather_subset: network
122     - debug: msg="Inventory target '{{ inventory_hostname }}' has the actual system hostname '{{ ansible_hostname }}'"
123     - name: Check Inventory Hostnames
124       debug:
125         msg:
126           - "Target '{{ inventory_hostname }}' in inventory does NOT match the actual system hostname '{{ ansible_hostname }}'."
127           - "If it's done intentionally, please ignore this message."
128       when:
129         - inventory_hostname != ansible_hostname
130
131 # Early check if SELinux is configured properly
132     - block:
133       - name: "Collect packages facts"
134         package_facts:
135       - debug:
136           msg:
137             - "Current SELinux status:"
138             - "status: {{ ansible_selinux.status | default('') }}"
139             - "policy version:  {{ ansible_selinux.policyvers | default('') }}"
140             - "type: {{ ansible_selinux.type | default('') }}"
141             - "mode: {{ ansible_selinux.mode | default('') }}"
142             - "config_mode: {{ ansible_selinux.config_mode | default('') }}"
143
144       - name: check selinux condition possibly causing system boot failure
145         debug:
146           msg:
147             - "Current SELinux setup might cause the system possibly will not boot up on next reboot."
148             - "Please, check SELinux settings and set it up according to the documentation."
149         when:
150           - "'selinux-policy' not in ansible_facts.packages"
151           - "'selinux-policy-targeted' not in ansible_facts.packages"
152       when:
153         - ansible_os_family == "RedHat"
154
155 # STORY: "cmk requires isolcpus to be configured"
156     - block:
157       - debug:
158           msg:
159             - cmk_enabled = {{ cmk_enabled }} (group_vars/all.yml)
160             - cmk_use_all_hosts = {{ cmk_use_all_hosts }} (group_vars/all.yml)
161             - cmk_hosts_list = {{ cmk_hosts_list | default('') }} (group_vars/all.yml)
162             - cmk_shared_num_cores = {{ cmk_shared_num_cores }} (group_vars/all.yml)
163             - cmk_exclusive_num_cores = {{ cmk_exclusive_num_cores }} (group_vars/all.yml)
164             - isolcpus_enabled = {{ isolcpus_enabled }} (host_vars)
165             - isolcpus = {{ isolcpus }} (host_vars)
166             - ansible_processor_count = {{ ansible_processor_count }}
167             - ansible_processor_cores = {{ ansible_processor_cores }}
168             - ansible_processor_threads_per_core = {{ ansible_processor_threads_per_core }}
169             - ansible_processor_vcpus = {{ ansible_processor_vcpus }}
170             - CPUs Reserved for OS = 0...{{ ansible_processor_count - 1 }}
171 #            - CPUs Reserved for OS = {{ lookup('sequence','0-{{ ansible_processor_count - 1 }}').split(',') }} # [E207] Nested jinja pattern
172
173       - name: Check Intel CMK Config
174         assert:
175           that: ({{ cmk_enabled }} and {{ isolcpus_enabled }} and "{{ isolcpus }}" | length > 0)
176           msg:
177             - Incorrect configuration pertaining Intel CMK. Conflicting or improper values detected
178             - When Intel CMK is enabled, CPUs isolation ('isolcpus') must be set according to the example file for host_vars. Please correct the configuration
179
180       - name: Split isolcpus Groups
181         set_fact:
182           isolcpus_groups: "{{ isolcpus.split(',') }}"
183
184       - debug: msg="isolcpus_groups = {{ isolcpus_groups }}"
185
186       - name: Filter isolcpus Ranges
187         set_fact:
188           isolcpus_ranges: "{{ isolcpus_ranges + [item] }}"
189         with_items: "{{ isolcpus_groups }}"
190         when: ("-" in item)
191
192       - debug: msg="isolcpus_ranges = {{ isolcpus_ranges }}"
193
194       - name: Filter isolcpus Discretes
195         set_fact:
196           isolcpus_discretes: "{{ isolcpus_discretes + [item] }}"
197         with_items: "{{ isolcpus_groups }}"
198         when: ("-" not in item)
199
200       - debug: msg="isolcpus_discretes = {{ isolcpus_discretes }}"
201
202       - name: Build isolcpus List
203         set_fact:
204           isolcpus_list: "{{ isolcpus_list | default([]) | union(isolcpus_discretes) | union([item]) }}"
205         with_sequence: "{{ isolcpus_ranges }}"
206
207       - debug: msg="isolcpus_list = {{ isolcpus_list }}"
208
209       - name: Check isolcpus Total
210         assert:
211           that: "{{ isolcpus_list | length }} <= ansible_processor_vcpus"
212           msg:
213             - Incorrect configuration pertaining isolcpus. Conflicting or improper values detected
214             - The number of isolcpus {{ isolcpus_list | length }}, exceeds total CPUs on target {{ ansible_processor_vcpus }}. Please correct the configuration
215         when: isolcpus is defined
216
217       - name: Check isolcpus IDs
218         assert:
219           that: "item | int <= ansible_processor_vcpus"
220           msg:
221             - Incorrect configuration pertaining isolcpus. Conflicting or improper values detected
222             - The CPU ID {{ item }} set for isolcpus is NOT actually present on target. Please correct the configuration
223         with_items: "{{ isolcpus_list }}"
224         when: isolcpus is defined
225
226       - name: Check isolcpus OS Reserved
227         assert:
228           that: "item not in isolcpus_list"
229           msg:
230             - Incorrect configuration pertaining isolcpus. Conflicting or improper values detected
231             - The CPU ID 0...{{ ansible_processor_count - 1 }} should NOT be set for isolcpus. Please correct the configuration
232         with_items: "{{ lookup('sequence','0-{{ ansible_processor_count - 1 }}').split(',') }}"
233         when: isolcpus is defined
234
235 #TODO relationship between cmk shared/exclusive cores and isolcpus
236
237       when:
238         - cmk_enabled is defined
239         - (not cmk_hosts_list is defined) or (inventory_hostname in cmk_hosts_list)  #CMK expected true for all profiles except basic
240       # {% if not cmk_use_all_hosts %}
241         - "'kube-node' in group_names"
242       # {% endif %}
243
244
245 ####################################
246 # Prerequisites for Worker Node(s) #
247 ####################################
248 - hosts: kube-node
249   vars:
250     phy_nics_pciids: []
251
252   tasks:
253
254 # STORY: "nic bus info specified is present on system"
255     - debug:
256         msg: "Dataplane (DP) interface(s) defined in host_vars = {{ dataplane_interfaces }}"
257       when: dataplane_interfaces is defined
258
259     - name: Check DP Interfaces
260       assert:
261         that: "dataplane_interfaces != []"
262         msg: "Dataplane (DP) interface(s) on target '{{ ansible_hostname }}' must be set in host_vars. Please correct the configuration"
263       when:
264         - dataplane_interfaces is defined
265         - (update_nic_drivers is defined and update_nic_drivers) or
266           (install_ddp_packages is defined and install_ddp_packages) or
267           (sriov_cni_enabled is defined and sriov_cni_enabled) or
268           (sriov_network_operator_enabled is defined and sriov_network_operator_enabled)
269
270     - debug:
271         msg: "Network interfaces present on target '{{ ansible_hostname }}' = {{ ansible_interfaces }}"
272
273     - name: Read Physical NICs PCIIDs
274       set_fact:
275         phy_nics_pciids: "{{ phy_nics_pciids + [ ansible_facts[item]['pciid'] ] }}"
276       with_items: "{{ ansible_interfaces }}"
277       when: ansible_facts[item]['pciid'] is defined and ansible_facts[item]['type'] == "ether"
278
279     - debug: msg="PCI Slots for the NICs on target '{{ ansible_hostname }}' = {{ phy_nics_pciids }}"
280
281     - name: Check DP Interfaces Names
282       assert:
283         that: ("{{ item.name }}" in {{ ansible_interfaces }})
284         msg: "Dataplane interface '{{ item.name }}' defined in host_vars does NOT exist on target. Please correct the configuration"
285       with_items: "{{ dataplane_interfaces }}"
286       when: dataplane_interfaces is defined and dataplane_interfaces != []
287       ignore_errors: True
288
289     - name: Check DP Interfaces Bus Info
290       assert:
291         that: ("{{ item.bus_info }}" in "{{ phy_nics_pciids }}")
292         msg: "Dataplane interface '{{ item.name }}' defined with PCI ID '{{ item.bus_info }}' does NOT exist on target. Please correct the configuration"
293       with_items: "{{ dataplane_interfaces }}"
294       when: dataplane_interfaces is defined and dataplane_interfaces != []
295       ignore_errors: True
296
297
298 # QAT Devices list is okay to be left empty (default), but if was defined, device(s) must exist on target
299     - debug:
300         msg: "QAT device(s) defined in host_vars = {{ qat_devices }}"
301       when: qat_devices is defined
302
303     - name: Read QAT PCIIDs
304       shell: lshw -businfo -numeric | grep -i quickassist
305       register: lshw_qat
306       ignore_errors: True
307       when: qat_devices is defined
308
309     - debug:
310         msg: "QAT devices found on target = {{ lshw_qat.stdout }}"
311       when: qat_devices is defined
312
313     - name: Check QAT Devices' Bus Info
314       assert:
315         that: ("{{ item.qat_id }}" in """{{ lshw_qat.stdout }}""")
316         msg: "QAT device '{{ item.qat_dev }}' defined with PCI ID '{{ item.qat_id }}' does NOT exist on target. Please correct the configuration"
317       with_items: "{{ qat_devices }}"
318       when: qat_devices is defined and qat_devices != []
319       ignore_errors: True
320
321 # STORY: "qat_sriov_numvfs should not exceed max supported (16) per each dev_ID"
322     - debug:
323         msg:
324           - qat_sriov_numvfs for {{ item.qat_id }} = {{ item.qat_sriov_numvfs }} (host_vars)
325           - update_qat_drivers = {{ update_qat_drivers }} (host_vars)
326       with_items: "{{ qat_devices }}"
327       when: qat_devices is defined and qat_devices != [] # update_qat_drivers expected as 'true' for all profiles except basic
328
329     - name: Check QAT SRIOV VFs
330       assert:
331         that: ({{ item.qat_sriov_numvfs }} <= 16)
332         msg:
333           - Incorrect configuration pertaining QAT SRIOV. Conflicting or improper values detected
334           - When SRIOV VFs are set for QAT, max value is 16 for each ID (max 48 total per card). Please correct the configuration
335       with_items: "{{ qat_devices }}"
336       when:
337         - update_qat_drivers is defined and update_qat_drivers
338         - qat_devices is defined and qat_devices != []
339 # OpenSSL & OpenSSL*Engine must only be configured / installed when update_qat_drivers is set to 'true' and qat_devices is defined in host vars
340     - name: check OpenSSL and OpenSSL*Engine requirements
341       assert:
342         that:
343           - update_qat_drivers
344           - qat_devices is defined and qat_devices != []
345         fail_msg: "OpenSSL & OpenSSL*Engine will only configured if update_qat_drivers is set to 'true' & qat_devices is defined in host vars"
346         success_msg: "OpenSSL & OpenSSL*Engine verification completed"
347       when: openssl_install is defined and openssl_install
348
349     - name: check KMRA requirements
350       assert:
351         that:
352           - sgx_dp_enabled
353         fail_msg: "KMRA installation requires sgx_dp_enabled set to 'true'"
354         success_msg: "KMRA requirements verified"
355       when: kmra_enabled is defined and kmra_enabled
356
357     - name: check SGX configuration
358       assert:
359         that:
360           - sgx_enabled
361         fail_msg: "SGX drivers installation requires sgx_enabled set to 'true'"
362         success_msg: "SGX configuration verified"
363       when:
364         - sgx_dp_enabled is defined and sgx_dp_enabled
365         - (ansible_distribution == 'Ubuntu' and ansible_distribution_version != '21.04')
366           or (ansible_os_family == 'RedHat' and ansible_distribution_version != '8.4')
367
368     - name: check NFD configuration
369       assert:
370         that:
371           - nfd_enabled
372         fail_msg: "SGX DP requires nfd_enabled set to 'true'"
373         success_msg: "NFD configuration verified"
374       when: sgx_dp_enabled is defined and sgx_dp_enabled
375
376     - name: check kmra_pccs_api_key presence
377       assert:
378         that:
379           - kmra_pccs_api_key is defined
380         fail_msg:
381           - "kmra_pccs_api_key is not defined"
382         success_msg: "kmra_pccs_api_key presence is verified"
383       when:
384         - kmra_enabled is defined and kmra_enabled
385
386     - name: check PCCS API key length
387       assert:
388         that:
389           - kmra_pccs_api_key | length == 32
390         fail_msg: "PCCS API Key should be 32 bytes long"
391         success_msg: "PCCS API key length verified"
392       when:
393         - kmra_enabled is defined and kmra_enabled
394
395     - name: check PCCS API key is not a placeholder
396       assert:
397         that:
398           - kmra_pccs_api_key is defined
399           - kmra_pccs_api_key != "ffffffffffffffffffffffffffffffff"
400         fail_msg:
401           - "Please, visit https://api.portal.trustedservices.intel.com/provisioning-certification and click on 'Subscribe'"
402           - "to generate PCCS API key."
403           - "PCCS API key is essential for KMRA deployment and usage."
404         success_msg: "PCCS API key verified"
405       when:
406         - kmra_enabled is defined and kmra_enabled
407
408 # STORY: "vpp/ovsdpdk require hugepage enabled and configured"
409     - debug:
410         msg:
411           - vpp_enabled = {{ vpp_enabled }} (host_vars)
412           - example_net_attach_defs = {{ example_net_attach_defs }} (group_vars/all.yml)
413           - userspace_ovs_dpdk = {{ example_net_attach_defs['userspace_ovs_dpdk'] }} (group_vars/all.yml)
414           - userspace_vpp = {{ example_net_attach_defs['userspace_vpp'] }} (group_vars/all.yml)
415           - sriov_net_dp = {{ example_net_attach_defs['sriov_net_dp'] }} (group_vars/all.yml)
416           - userspace_cni_enabled = {{ userspace_cni_enabled }} (host_vars)
417           - sriov_cni_enabled = {{ sriov_cni_enabled }} (host_vars)
418           - sriov_network_operator_enabled = {{ sriov_network_operator_enabled }} (host_vars)
419           - bond_cni_enabled = {{ bond_cni_enabled }} (host_vars)
420           - ovs_dpdk_enabled = {{ ovs_dpdk_enabled }} (host_vars)
421           - userspace_cni_enabled = {{ userspace_cni_enabled }} (host_vars)
422           - hugepages_enabled = {{ hugepages_enabled }} (host_vars)
423           - default_hugepage_size = {{ default_hugepage_size }} (host_vars)
424           - number_of_hugepages = {{ number_of_hugepages }} (host_vars)
425       when: vpp_enabled is defined #host_vars
426
427     - name: Check OVS DPDK Dependencies
428       assert:
429         that: >-
430           ({{ ovs_dpdk_enabled }} and not {{ vpp_enabled }} and {{ hugepages_enabled }} and
431           "{{ default_hugepage_size }}" == "1G" and {{ number_of_hugepages }} >= 0)
432           or {{ vpp_enabled }}
433         msg:
434           - Incorrect configuration pertaining OVS DPDK. Conflicting or improper values detected
435           - When OVS DPDK is enabled, VPP must be disabled and Hugepages must be set to 1G according to host_vars example. Please correct the configuration
436       when: ovs_dpdk_enabled is defined and ovs_dpdk_enabled
437
438     - name: Check VPP Dependencies
439       assert:
440         that: >-
441           ({{ vpp_enabled }} and not {{ ovs_dpdk_enabled }} and {{ hugepages_enabled }} and
442           "{{ default_hugepage_size }}" == "2M" and {{ number_of_hugepages }} >= 0)
443           or {{ ovs_dpdk_enabled }}
444         msg:
445           - Incorrect configuration pertaining VPP. Conflicting or improper values detected
446           - When VPP is enabled, OVS DPDK must be disabled and Hugepages must be set to 2M according to host_vars example. Please correct the configuration
447       when: vpp_enabled is defined and vpp_enabled
448
449
450 # STORY: "cnis require net-attach-defs to be enabled"
451     - name: Check CNI Config
452       assert:
453         that: >-
454           ({{ userspace_cni_enabled }} and {{ ovs_dpdk_enabled }} and {{ example_net_attach_defs['userspace_ovs_dpdk'] }} and not {{ vpp_enabled }} and
455           not {{ example_net_attach_defs['userspace_vpp'] }} and {{ hugepages_enabled }} and
456           "{{ default_hugepage_size }}" == "1G" and {{ number_of_hugepages }} >= 0)
457           or ({{ userspace_cni_enabled }} and not {{ ovs_dpdk_enabled }} and not {{ example_net_attach_defs['userspace_ovs_dpdk'] }} and {{ vpp_enabled }}
458           and {{ example_net_attach_defs['userspace_vpp'] }} and {{ hugepages_enabled }} and
459           "{{ default_hugepage_size }}" == "2M" and {{ number_of_hugepages }} >= 0)
460         msg:
461           - Incorrect configuration pertaining CNI. Conflicting or improper values detected.
462           - When CNI is enabled, either OVS DPDK either VPP must be enabled and Hugepages must be according to example files. Please correct the configuration
463       when: userspace_cni_enabled is defined and userspace_cni_enabled
464
465
466 # STORY: "If SST enabled, confirm minimum kernel or kernel_update specified"
467     - name: Check SST # see Jira NPF-1545
468       assert:
469         that: (not sst_bf_configuration_enabled)
470         msg: "SST-BF is NOT supported on {{ ansible_distribution }} {{ ansible_distribution_version }}. Please use a different OS or disable this feature"
471       when:
472         - sst_bf_configuration_enabled is defined
473         - (ansible_distribution == "RedHat" and ansible_distribution_version == '8.2') or ansible_distribution_version in ['7.6', '7.8', '7.9', '18.04']
474       ignore_errors: True
475
476 # STORY: Intel VT-d should be enabled in BIOS
477     - name: Check Intel VT-d
478       shell: dmesg | grep DMAR | grep remapping
479       register: dmesg_dmar_remap
480       ignore_errors: True
481       changed_when: False
482
483     - debug: msg="dmesg >> {{ dmesg_dmar_remap.stdout }}"
484
485     - name: Warn about Intel VT-d
486       fail:
487         msg: "Warning: Intel VT-d appears DISABLED on target.  Please check BIOS under 'Advanced > Integrated IO Configuration' and Enable if necessary"
488       when: dmesg_dmar_remap.stdout|length  == 0
489       ignore_errors: True
490
491
492 # STORY: CPU Hyper-Threading should be enabled in BIOS
493     - name: Warn about Hyper-Threading
494       fail:
495         msg: "Warning: CPU Hyper-Threading is DISABLED on target.  Please check BIOS under 'Advanced > Processor Configuration' and Enable if necessary"
496       when: ansible_processor_threads_per_core != 2
497       ignore_errors: True
498
499
500 # STORY: "check for collectd. See Jira NPF-1687"
501     - name: Warn about collectd
502       fail:
503         msg: "Warning: On {{ ansible_distribution }} {{ ansible_distribution_version }} collectd won't work unless 'update_kernel' is enabled in group_vars"
504       when: ansible_distribution_version in ['7.6', '18.04']
505       ignore_errors: True
506
507
508 # STORY: TEMPORARY: "ovs dpdk version requirements"
509     - debug:
510         msg:
511           - install_dpdk = {{ install_dpdk }} (host_vars)
512           - dpdk_version = {{ dpdk_version }} (host_vars)
513           - ovs_dpdk_enabled = {{ ovs_dpdk_enabled }} (host_vars)
514           - ovs_version = {{ ovs_version }} (host_vars)
515       when:
516         - install_dpdk is defined #host_vars
517         - dpdk_version is defined #host_vars
518         - ovs_version is defined #host_vars
519         - ovs_dpdk_enabled is defined and ovs_dpdk_enabled #host_vars
520
521     - name: Check OVS DPDK compatibility
522       assert:
523         that: >-
524           "{{ ovs_version }} == \"v2.15.0\" and {{ dpdk_version }} >= \"20.11\""
525           or "{{ ovs_version }} == \"v2.14.2\" and {{ dpdk_version }} == \"19.11.6\""
526           or "{{ ovs_version }} == \"v2.14.1\" and {{ dpdk_version }} == \"19.11.6\""
527           or "{{ ovs_version }} == \"v2.14.0\" and {{ dpdk_version }} == \"19.11.6\""
528           or "{{ ovs_version }} == \"v2.13.3\" and {{ dpdk_version }} == \"19.11.6\""
529           or "{{ ovs_version }} == \"v2.13.2\" and {{ dpdk_version }} == \"19.11.6\""
530           or "{{ ovs_version }} == \"v2.13.1\" and {{ dpdk_version }} == \"19.11.6\""
531           or "{{ ovs_version }} == \"v2.13.0\" and {{ dpdk_version }} == \"19.11.6\""
532         msg: "OVS {{ ovs_version }} does not build with DPDK version {{ dpdk_version }}. Please correct the host_vars configuration"
533       when:
534         - dpdk_version is defined #host_vars
535         - ovs_version is defined #host_vars
536         - ovs_dpdk_enabled is defined and ovs_dpdk_enabled #host_vars
537
538
539     - meta: end_play
540
541 #    - name: Print all variables/facts known for a host
542 #      ansible.builtin.debug:
543 #        var: hostvars[inventory_hostname]
544 #        verbosity: 4