mirror of
https://github.com/dredx/prole.git
synced 2026-09-24 15:04:31 +00:00
35 lines
951 B
YAML
35 lines
951 B
YAML
---
|
|
- name: Install iSCSI dependencies
|
|
ansible.builtin.package:
|
|
name:
|
|
- open-iscsi
|
|
- util-linux
|
|
state: present
|
|
|
|
- name: Ensure iscsid enabled
|
|
ansible.builtin.service:
|
|
name: iscsid
|
|
state: started
|
|
enabled: true
|
|
|
|
- name: Configure and login iSCSI targets
|
|
ansible.builtin.include_tasks: iscsi_target.yml
|
|
loop: "{{ iscsi_targets | default([]) }}"
|
|
loop_control:
|
|
loop_var: t
|
|
|
|
- name: Mount filesystems for iSCSI targets
|
|
ansible.builtin.include_tasks: iscsi_mount.yml
|
|
loop: "{{ iscsi_targets | default([]) | map(attribute='mounts') | list | flatten }}"
|
|
loop_control:
|
|
loop_var: m
|
|
|
|
- name: Guardrail - ensure required mountpoints are mounted
|
|
ansible.builtin.command: "findmnt -n {{ item.path }}"
|
|
register: _findmnt
|
|
changed_when: false
|
|
failed_when: _findmnt.rc != 0
|
|
loop: "{{ iscsi_targets | default([]) | map(attribute='mounts') | list | flatten }}"
|
|
loop_control:
|
|
label: "{{ item.path }}"
|