Files
ansible-manage-lvm/tasks/debian.yml
T
Spirit-act ff13947aaf fix: use explicit boolean check for Ansible 2.19+ compatibility
Fixes implicit truthy conditional that fails in Ansible 2.19+.

Changes `when: scsi_devices['stdout'] | length` to `when: scsi_devices['stdout'] | length > 0` to return an explicit boolean value instead of an integer.

Closes #146 (duplicate PR)
2025-11-01 15:55:35 -04:00

41 lines
933 B
YAML

---
- name: debian | Updating Apt Cache
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
become: true
- name: debian | installing pre-reqs
ansible.builtin.apt:
name:
- lvm2
- scsitools
state: present
become: true
- name: debian | install xfs tools
ansible.builtin.apt:
name: xfsprogs
state: present
become: true
loop: "{{ lvm_groups | subelements('lvnames') }}"
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
ansible.builtin.command: sg_scan
become: true
register: scsi_devices
changed_when: false
- name: debian | rescanning for new disks added
ansible.builtin.command: "{{ rescan_scsi_command }}"
become: true
changed_when: false
when: scsi_devices['stdout'] | length > 0