blob: 1e6905e55925c625d93317d8e399b9c248e403a3 [file] [log] [blame]
Hyunsun Moon4f9c1cd2021-06-03 09:15:55 -07001---
2# sriov handlers/main.yml
3#
4# SPDX-FileCopyrightText: © 2021 Open Networking Foundation <support@opennetworking.org>
5# SPDX-License-Identifier: Apache-2.0
6
7- name: enable sriov.service
8 systemd:
9 name: sriov
10 daemon_reload: true
11 enabled: true
12
13- name: update grub
14 command: update-grub
15 notify: reboot
16
17- name: reboot
18 reboot:
19 test_command: "systemctl show -p LoadState sriov.service | grep loaded"
Hyunsun Moon1f2703d2021-07-28 09:43:30 -070020 notify:
21 - ensure vtd
22 - ensure vfs
23
24- name: ensure vtd
25 shell: "set -o pipefail && dmesg | grep DMAR-IR"
26 args:
27 executable: /bin/bash
28 register: check_vt_d
29 changed_when: check_vt_d.rc != 0
30 failed_when: check_vt_d.rc != 0
31 when: molecule_handler_notest is not defined
Hyunsun Moon4f9c1cd2021-06-03 09:15:55 -070032
33- name: ensure vfs
34 command: "cat /sys/class/net/{{ sriov_pf_name }}/device/sriov_numvfs"
35 register: confirm_vfs
36 changed_when: confirm_vfs.stdout | int == 0
37 failed_when: confirm_vfs.stdout | int == 0
38 when: molecule_handler_notest is not defined