-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathiscsi_srv.sls
65 lines (64 loc) · 1.99 KB
/
iscsi_srv.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{% if grains['provider'] == 'aws' %}
{% set devicepartprefix = 'p' %}
{% else %}
{% set devicepartprefix = '' %}
{% endif %}
{% set devicenum = 'abcdefghijklmnopqrstuvwxyz' %}
{% set partitions = grains['partitions'] %}
{% set real_iscsidev = salt['cmd.run']('realpath '~grains['iscsidev']) %}
iscsi:
target:
pkgs:
wanted:
{%- if grains['osmajorrelease'] == 12 %}
- targetcli-fb
- python-dbus-python
{%- else %}
- targetcli-fb-common
- python3-targetcli-fb
{%- endif %}
- yast2-iscsi-lio-server
config:
data:
lio:
fabric_modules:
iscsi_server:
authenticate_target: 'false'
enforce_discovery_auth: 'false'
name: "iscsi"
storage_objects:
{%- for partition in partitions %}
sd{{ devicenum[loop.index0] }}:
attributes:
block_size: 512
emulate_write_cache: 0
unmap_granularity: 0
dev: {{ real_iscsidev }}{{ devicepartprefix }}{{ loop.index }}
name: sd{{ devicenum[loop.index0] }}
plugin: "block"
{%- endfor %}
targets:
iscsi_server:
fabric: iscsi
tpgs:
attributes:
authentication: 0
cache_dynamic_acls: 0
default_cmdsn_depth: 16
demo_mode_write_protect: 0
generate_node_acls: 1
login_timeout: 15
netif_timeout: 2
prod_mode_write_protect: 0
luns:
{%- for partition in partitions %}
sd{{ devicenum[loop.index0] }}:
index: {{ loop.index0 }}
storage_object: /backstores/block/sd{{ devicenum[loop.index0] }}
{%- endfor %}
portals:
iscsi_server:
ip_address: {{ grains['iscsi_srv_ip'] }}
port: 3260
tag: 1
wwn: "iqn.1996-04.de.suse:01:a66aed20e2f3"