blob: e699bf564fdae51c9dfdda99cd3bf213c24a0198 [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"
20 notify: ensure vfs
21
22- name: ensure vfs
23 command: "cat /sys/class/net/{{ sriov_pf_name }}/device/sriov_numvfs"
24 register: confirm_vfs
25 changed_when: confirm_vfs.stdout | int == 0
26 failed_when: confirm_vfs.stdout | int == 0
27 when: molecule_handler_notest is not defined