+ with_dict: "{{ item.sriov_vfs | default({}) | combine({'default': item.default_vf_driver}) }}"
+ loop_control:
+ loop_var: vf_driver
+
+- name: pre-create empty dict for VFs
+ set_fact:
+ vfs_acc: {}
+
+- name: populate VFs dict with values
+ set_fact:
+ vfs_acc: "{{ vfs_acc | combine({idx : item.default_vf_driver}) }}"
+ loop: "{{ range(item.sriov_numvfs | default(0) | int) | list }}"
+ loop_control:
+ index_var: idx
+ loop_var: vf_default
+
+- name: update VFs dict with default drivers
+ set_fact:
+ vfs_acc: "{{ vfs_acc | combine({vf.key | regex_replace('.*_(\\d*)', '\\1') | int : vf.value}) }}"
+ loop: "{{ item.sriov_vfs | default({}) | dict2items | sort(attribute='key') }}"
+ loop_control:
+ loop_var: vf
+ extended: yes
+ when: ansible_loop.index < (item.sriov_numvfs | default(0) | int )