Cleaned up distro specific tasks

- Cleaned up conditions, etc.
This commit is contained in:
Larry Smith Jr
2020-04-19 12:03:34 -04:00
parent 52c0270a53
commit ec0737d26b
2 changed files with 29 additions and 29 deletions

View File

@@ -1,14 +1,14 @@
---
- name: centos | installing lvm2
package:
name: "lvm2"
state: "present"
name: lvm2
state: present
become: true
- name: centos | installing sg3_utils
package:
name: "sg3_utils"
state: "present"
name: sg3_utils
state: present
become: true
- name: centos | debug lvg
@@ -36,12 +36,12 @@
- lv.1.create|bool
- name: centos | checking for scsi devices
command: "sg_scan"
command: sg_scan
become: true
register: "scsi_devices"
register: scsi_devices
changed_when: false
- name: centos | rescanning for new disks
command: "/usr/bin/rescan-scsi-bus.sh"
command: /usr/bin/rescan-scsi-bus.sh
become: true
changed_when: false

View File

@@ -1,40 +1,40 @@
---
- name: debian | Updating Apt Cache
apt:
update_cache: true
cache_valid_time: 3600
become: true
- name: debian | installing pre-reqs
package:
apt:
name:
- lvm2
- scsitools
state: "present"
state: present
become: true
- name: debian | install xfs tools
package:
name: "xfsprogs"
state: "present"
become: yes
apt:
name: xfsprogs
state: present
become: true
loop: "{{ lvm_groups|subelements('lvnames') }}"
when: >
(
(item.1 is defined and item.1 != 'None') and
(
item.1.filesystem is defined and
item.1.filesystem == "xfs"
)
and
(
item.1.create is defined and
item.1.create
)
)
when:
- item.1 is defined
- item.1 != 'None'
- item.1.filesystem is defined
- item.1.filesystem == "xfs"
- item.1.create is defined
- item.1.create|bool
- name: debian | checking for scsi devices
command: "sg_scan"
command: sg_scan
become: true
register: "scsi_devices"
register: scsi_devices
changed_when: false
- name: debian | rescanning for new disks added
command: "/sbin/rescan-scsi-bus"
command: /sbin/rescan-scsi-bus
become: true
changed_when: false
when: scsi_devices['stdout'] | length