blob: faf1243624fbc135af4c55f9d670897e6d844a7f [file] [log] [blame]
Hyunsun Moon4f9c1cd2021-06-03 09:15:55 -07001---
2# sriov molecule/default/verify.yml
3#
4# SPDX-FileCopyrightText: © 2021 Open Networking Foundation <support@opennetworking.org>
5# SPDX-License-Identifier: Apache-2.0
6
7- name: Verify
8 hosts: all
9 tasks:
10 - name: Gather service facts
11 service_facts:
12
13 - name: Verify sriov.service is installed
14 assert:
15 that: "'{{ item }}' in ansible_facts.services"
16 with_items:
17 - sriov.service
18
19 - name: Verify sriov.service is loaded and configured correctly
20 # noqa 303
21 command: "systemctl status sriov.service"
22 register: cmdline
23 changed_when: false
24 failed_when: item not in cmdline.stdout
25 with_items:
26 - loaded
27 - Resetting PF eth0
28
29 - name: Verify kernel boot parameters
30 command: "cat /proc/cmdline"
31 register: cmdline
32 changed_when: false
33 failed_when: item not in cmdline.stdout
34 with_items:
35 - intel_iommu=on
36 - transparent_hugepage=never
37 - default_hugepagesz=1G
38 - hugepagesz=1G hugepages=32
39
40 - name: Verify vfio-pci module is loaded
41 shell: "set -o pipefail && lsmod | grep vfio_pci > /dev/null"
42 args:
43 executable: /bin/bash
44 register: vfio_pci
45 changed_when: vfio_pci.rc != 0
46 failed_when: vfio_pci.rc != 0
47 when: ansible_kernel is version('5.4','<')