mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-27 00:05:44 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
10
roles/iscsi_target/defaults/main.yml
Normal file
10
roles/iscsi_target/defaults/main.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
iscsi_src_ip: []
|
||||
iscsi_ports:
|
||||
- 3260
|
||||
# Can be used to restrict firewall on the specified interface
|
||||
# iscsi_bind_interface: eno4.33
|
||||
|
||||
# Should the target service be started and enabled automaticaly
|
||||
iscsi_enabled: True
|
20
roles/iscsi_target/tasks/main.yml
Normal file
20
roles/iscsi_target/tasks/main.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
|
||||
- name: Install packages
|
||||
yum:
|
||||
name:
|
||||
- targetcli
|
||||
tags: iscsi
|
||||
|
||||
- name: Handle iSCSI ports in the firewall
|
||||
iptables_raw:
|
||||
name: iscsi_ports
|
||||
state: "{{ (iscsi_src_ip | length > 0) | ternary('present','absent') }}"
|
||||
rules: "-A INPUT -p tcp -m multiport --dports {{ iscsi_ports | join(',') }} {% if iscsi_bind_interface is defined %}-i {{ iscsi_bind_interface }} {% endif %}-s {{ iscsi_src_ip | join(',') }} -j ACCEPT"
|
||||
when: iptables_manage | default(True)
|
||||
tags: [firewall,iscsi]
|
||||
|
||||
- name: Enable target service
|
||||
service: name=target state=started enabled=True
|
||||
when: iscsi_enabled == True
|
||||
tags: iscsi
|
Reference in New Issue
Block a user