Hyunsun Moon | 4f9c1cd | 2021-06-03 09:15:55 -0700 | [diff] [blame] | 1 | --- |
| 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 Moon | 1f2703d | 2021-07-28 09:43:30 -0700 | [diff] [blame] | 20 | 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 Moon | 4f9c1cd | 2021-06-03 09:15:55 -0700 | [diff] [blame] | 32 | |
| 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 Rosa | 32c5322 | 2022-01-28 15:54:37 +0100 | [diff] [blame] | 39 | |
| 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 |