blob: fd2805ccca334e6565e60490ac6e7abfd2dccc92 [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
Raphael Vicente Rosa32c53222022-01-28 15:54:37 +010039
40- name: enable sriov_qat.service
41 systemd:
42 name: sriov_qat
43 daemon_reload: true
44 enabled: true
45
46- name: reboot qat
47 reboot:
48 msg: "Reboot initiated by Ansible - QAT drivers blacklist task"
49 connect_timeout: 5
50 reboot_timeout: 600
51 pre_reboot_delay: 0
52 post_reboot_delay: 30
53 test_command: whoami