File tree Expand file tree Collapse file tree
playbooks/roles/network_info/tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 content : " {{ network_info | to_nice_json }}"
3535 mode : 0755
3636 when : networkinfo_file.failed
37+
38+ - name : Find network devices with a device link
39+ find :
40+ paths : /sys/class/net
41+ patterns :
42+ - device
43+ file_type : link
44+ follow : true
45+ depth : 2
46+ recurse : true
47+ use_regex : false
48+ register : device_links
49+
50+ - name : Extract paths from device_links
51+ set_fact :
52+ device_links : " {{ device_links.files | map(attribute='path') | list }}"
53+
54+ - name : Extract device names from device_links
55+ set_fact :
56+ network_devices : " {{ network_devices + [ item | dirname | basename ] }}"
57+ loop : " {{ device_links }}"
58+ vars :
59+ network_devices : []
60+
61+ - name : Initialise SR-IOV PFs to an empty list
62+ set_fact :
63+ sriov_pfs : []
64+
65+ - name : Find SR-IOV PFs
66+ find :
67+ paths : " {{ device_links }}"
68+ patterns :
69+ - sriov_totalvfs
70+ register : sriov_totalvfs
71+
72+ - name : Extract device names for SR-IOV PFs
73+ set_fact :
74+ sriov_pfs : " {{ sriov_pfs + [ item | dirname | dirname | basename ] }}"
75+ loop : " {{ sriov_totalvfs.files | map(attribute='path') | list }}"
76+
77+ - name : Initialise SR-IOV VFs to an empty list
78+ set_fact :
79+ sriov_vfs : []
80+
81+ - name : Find SR-IOV VFs
82+ find :
83+ paths : " {{ device_links }}"
84+ patterns :
85+ - physfn
86+ file_type : link
87+ register : sriov_physfndir
88+
89+ - name : Extract device names for SR-IOV VFs
90+ set_fact :
91+ sriov_vfs : " {{ sriov_vfs + [ item | dirname | dirname | basename ] }}"
92+ loop : " {{ sriov_physfndir.files | map(attribute='path') | list }}"
You can’t perform that action at this time.
0 commit comments