Merge pull request #73 from mnasiadka/mnasiadka/nvme_only

centos: Skip SCSI tasks on NVMe only hosts
This commit is contained in:
Larry Smith Jr 2022-01-04 14:47:16 -05:00 committed by GitHub
commit 263c8d2b3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 30 additions and 14 deletions

View File

@ -34,20 +34,36 @@
- lv.1.create is defined
- lv.1.create|bool
- name: centos | checking for scsi devices
command: sg_scan
- name: centos | check for scsi adapters
find:
paths: "/sys/class/scsi_host"
file_type: any
become: true
register: scsi_devices
changed_when: false
register: scsi_adapters
- name: centos | rescanning for new disks
command: /usr/bin/rescan-scsi-bus.sh
become: true
changed_when: false
when: scsi_devices.stdout|length > 0
- block:
- name: centos | installing sg3_utils
package:
name: sg3_utils
state: present
become: true
- name: centos | rescanning for resized disks
command: /usr/bin/rescan-scsi-bus.sh -s
become: true
changed_when: false
when: scsi_devices.stdout|length > 0
- name: centos | checking for scsi devices
command: sg_scan
become: true
register: scsi_devices
changed_when: false
- name: centos | rescanning for new disks
command: /usr/bin/rescan-scsi-bus.sh
become: true
changed_when: false
when: scsi_devices.stdout|length > 0
- name: centos | rescanning for resized disks
command: /usr/bin/rescan-scsi-bus.sh -s
become: true
changed_when: false
when: scsi_devices.stdout|length > 0
when: scsi_adapters.matched > 0