|
2 | 2 |
|
3 | 3 | # TODO: running on master node for now (fix to run on multiple nodes)
|
4 | 4 |
|
5 |
| -- name: check VF resources and bind them to vfio-pci |
| 5 | +- name: check VF resources |
6 | 6 | block:
|
7 | 7 | - name: Get number of VF's available for the "{{ core.data_iface }}"
|
8 | 8 | shell: ip link show "{{ core.data_iface }}" | grep -c vf
|
|
17 | 17 | that:
|
18 | 18 | - vf_status.stdout | int >= 2
|
19 | 19 |
|
20 |
| - - name: Get number of VF's attached to vfio-pci driver |
21 |
| - shell: driverctl -v list-overrides | grep 'vfio-pci' | wc -l |
22 |
| - register: vf_status |
23 |
| - changed_when: false |
24 |
| - |
25 |
| - - debug: |
26 |
| - var=vf_status.stdout |
27 |
| - |
28 |
| - - name: verify at least two VF resourses attached to vfio-pci driver |
29 |
| - ansible.builtin.assert: |
30 |
| - that: |
31 |
| - - vf_status.stdout | int >= 2 |
32 |
| - |
33 |
| - when: inventory_hostname in groups['master_nodes'] and core.upf.mode == "dpdk" |
34 |
| - |
35 |
| -- name: deploy sriov plugins |
36 |
| - block: |
37 |
| - - name: copy sriov-device-plugin.yaml to /tmp/sriov-device-plugin.yaml |
38 |
| - template: |
39 |
| - src: roles/sriov/templates/sriov-device-plugin.yaml |
40 |
| - dest: "/tmp/sriov-device-plugin.yaml" |
41 |
| - |
42 |
| - - name: copy sriov-device-plugin-config.yaml to /tmp/sriov-device-plugin-config.yaml |
43 |
| - template: |
44 |
| - src: roles/sriov/templates/sriov-device-plugin-config.yaml |
45 |
| - dest: "/tmp/sriov-device-plugin-config.yaml" |
46 |
| - |
47 |
| - - name: update proper data interface name in /tmp/sriov-device-plugin-config.yaml |
48 |
| - shell: sed -i -e "s/PFDEV/{{ core.data_iface }}/g" /tmp/sriov-device-plugin-config.yaml |
49 |
| - |
50 |
| - - name: apply /tmp/sriov-device-plugin.yaml |
51 |
| - shell: kubectl apply -f /tmp/sriov-device-plugin.yaml |
52 |
| - |
53 |
| - - name: apply /tmp/sriov-device-plugin-config.yaml |
54 |
| - shell: kubectl apply -f /tmp/sriov-device-plugin-config.yaml |
55 |
| - |
56 |
| - - name: Get Sriov Pods Status |
57 |
| - shell: kubectl get pods -A | grep sriov |
58 |
| - register: pod_status |
59 |
| - changed_when: false |
60 |
| - |
61 |
| - - name: restart sriov Pod |
62 |
| - shell: | |
63 |
| - while IFS= read -r line; do |
64 |
| - name=$(echo "$line" | awk '{print $2}') |
65 |
| - status=$(echo "$line" | awk '{print $4}') |
66 |
| -
|
67 |
| - kubectl delete pod "$name" |
68 |
| - done <<< "{{ pod_status.stdout }}" |
69 |
| - args: |
70 |
| - executable: /bin/bash |
71 |
| - - pause: |
72 |
| - seconds: 10 |
73 | 20 | when: inventory_hostname in groups['master_nodes'] and core.upf.mode == "dpdk"
|
0 commit comments