diff --git a/ansible_image_validation/validation-playbooks/nvme_driver_validation.yaml b/ansible_image_validation/validation-playbooks/nvme_driver_validation.yaml new file mode 100644 index 00000000..371ef3dc --- /dev/null +++ b/ansible_image_validation/validation-playbooks/nvme_driver_validation.yaml @@ -0,0 +1,32 @@ + +--- + +- name: Check if the nvme driver is present in all images + shell: lsinitrd /boot/initramfs-{{ ansible_facts.kernel }}.img | grep nvme + register: check_nvme_allimages + +- debug: + msg: "NVME Validation is successful since nvme driver is present" + +- name: "Write to error msg if some drivers are not present" + lineinfile: + path: "{{err_folder}}/err_msgs.log" + line: "\n NVME validation failed since nvme driver is not present." + create: yes + state: present + when: ("nvme" not in check_nvme_allimages.stdout) + +- name: Check if the pci driver is present in all images + shell: lsinitrd /boot/initramfs-{{ ansible_facts.kernel }}.img | grep pci + register: check_pci_allimages + +- debug: + msg: "NVME Validation is successful since nvme driver is present" + +- name: "Write to error msg if some drivers are not present" + lineinfile: + path: "{{err_folder}}/err_msgs.log" + line: "\n NVME validation failed since pci driver is not present. " + create: yes + state: present + when: ("pci" not in check_pci_allimages.stdout) \ No newline at end of file diff --git a/ansible_image_validation/validation-playbooks/per-vm-validation.yaml b/ansible_image_validation/validation-playbooks/per-vm-validation.yaml index 32391692..e305137e 100644 --- a/ansible_image_validation/validation-playbooks/per-vm-validation.yaml +++ b/ansible_image_validation/validation-playbooks/per-vm-validation.yaml @@ -50,10 +50,14 @@ state: present when: users_on_machine.stdout_lines[0] != '0' +- name: Check if NVME Validation is valid for this VM + include_tasks: validation-playbooks/nvme_driver_validation.yaml + ignore_errors: yes + - name: check if ADE validation is valid for this vm include_tasks: validation-playbooks/ade_packages_validation.yaml ignore_errors: yes - when: ansible_os_family == "RedHat" and (ansible_distribution_major_version == '8' or ansible_distribution_major_version == '7') and (repo_type == 'base' or repo_type =='beta') + when: ansible_os_family == "RedHat" and (ansible_distribution_major_version == '8' or ansible_distribution_major_version == '7') and (repo_type == 'base' or repo_type =='beta') - name: Check if blacklisted drivers are blacklisted by modprobe service include_tasks: validation-playbooks/blacklisted_drivers_validation.yaml