From 43b2ad458441ddee12f1337febb8948e5b328a66 Mon Sep 17 00:00:00 2001 From: N Date: Wed, 11 Sep 2019 16:44:05 +0100 Subject: [PATCH] fix(os): fix open-iscsi on archlinux --- iscsi/initiator/install.sls | 6 +++++- iscsi/osfamilymap.yaml | 6 ++++++ iscsi/target/install.sls | 2 +- pillar.example | 17 +++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/iscsi/initiator/install.sls b/iscsi/initiator/install.sls index cb663696..523b98d9 100644 --- a/iscsi/initiator/install.sls +++ b/iscsi/initiator/install.sls @@ -76,7 +76,7 @@ iscsi_initiator_service_config: data: {{ data|json }} component: 'initiator' provider: {{ provider }} - json: {{ data['man5']['format']['json'] }} + json: {{ data['man5']['format']['json']|json }} {%- if iscsi.kernel.mess_with_kernel and data.man5.kmodule and data.man5.kloadtext %} iscsi_initiator_kernel_module: @@ -122,7 +122,11 @@ iscsi_initiator_service: - watch: - file: iscsi_initiator_service_config {%- endif %} + {%- if data.man5.svcname is iterable and data.man5.svcname is not string %} + - names: {{ data.man5.svcname|json }} + {%- else %} - name: {{ data.man5.svcname }} + {%- endif %} {%- if data.man5.kmodule %} - unless: {{ iscsi.kernel.modquery }} {{ data.man5.kmodule }} {%- endif %} diff --git a/iscsi/osfamilymap.yaml b/iscsi/osfamilymap.yaml index 158b7a1c..e54238a5 100644 --- a/iscsi/osfamilymap.yaml +++ b/iscsi/osfamilymap.yaml @@ -58,6 +58,12 @@ Gentoo: kmodule: iscsi_tcp Arch: + initiator: + open-iscsi: + man5: + svcname: ##open-iscsi on archlinux uses non-standard service names + - iscsi + - iscsid user: iscsimake client: make: diff --git a/iscsi/target/install.sls b/iscsi/target/install.sls index 3fe990e0..94d9dd5a 100644 --- a/iscsi/target/install.sls +++ b/iscsi/target/install.sls @@ -76,7 +76,7 @@ iscsi_target_service_config: data: {{ data|json }} component: 'target' provider: {{ provider }} - json: {{ data['man5']['format']['json'] }} + json: {{ data['man5']['format']['json']|json }} {%- if iscsi.kernel.mess_with_kernel and data.man5.kmodule and data.man5.kloadtext %} iscsi_target_kernel_module: diff --git a/pillar.example b/pillar.example index c8b94f57..cff13153 100644 --- a/pillar.example +++ b/pillar.example @@ -1,5 +1,22 @@ #Sample pillars for iSNS/iSCSI on FreeBSD and GNU/Linux + {% if grains.os == 'Arch' %} + ### this user is needed for archlinux +users: + iscsimake: + sudouser: True + shell: /bin/bash + empty_password: True + home: /home/iscsimake + createhome: True + optional_groups: + - wheel + - root + sudo_rules: + - 'ALL=(ALL) ALL' + {% endif %} + + iscsi: isns: enabled: True