blob: fd2805ccca334e6565e60490ac6e7abfd2dccc92 [file] [log] [blame]
---
# sriov handlers/main.yml
#
# SPDX-FileCopyrightText: © 2021 Open Networking Foundation <support@opennetworking.org>
# SPDX-License-Identifier: Apache-2.0
- name: enable sriov.service
systemd:
name: sriov
daemon_reload: true
enabled: true
- name: update grub
command: update-grub
notify: reboot
- name: reboot
reboot:
test_command: "systemctl show -p LoadState sriov.service | grep loaded"
notify:
- ensure vtd
- ensure vfs
- name: ensure vtd
shell: "set -o pipefail && dmesg | grep DMAR-IR"
args:
executable: /bin/bash
register: check_vt_d
changed_when: check_vt_d.rc != 0
failed_when: check_vt_d.rc != 0
when: molecule_handler_notest is not defined
- name: ensure vfs
command: "cat /sys/class/net/{{ sriov_pf_name }}/device/sriov_numvfs"
register: confirm_vfs
changed_when: confirm_vfs.stdout | int == 0
failed_when: confirm_vfs.stdout | int == 0
when: molecule_handler_notest is not defined
- name: enable sriov_qat.service
systemd:
name: sriov_qat
daemon_reload: true
enabled: true
- name: reboot qat
reboot:
msg: "Reboot initiated by Ansible - QAT drivers blacklist task"
connect_timeout: 5
reboot_timeout: 600
pre_reboot_delay: 0
post_reboot_delay: 30
test_command: whoami