Skip to content

Commit

Permalink
fix(os): better os mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Oct 4, 2019
1 parent 118a2d6 commit 55e4cfb
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 19 deletions.
28 changes: 23 additions & 5 deletions iscsi/oscodename.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
pkgs:
{%- if name in ('wheezy', 'trusty',) %}
wanted: ['isns', 'isns-client']
{%- elif name in ('stretch',) %}
wanted: ['libisns0',]
{%- elif name in ('xenial', 'jessie') %}
wanted: []
{%- else %}
Expand All @@ -16,29 +18,43 @@
pkgs:
{%- if name in ('wheezy', 'trusty',) %}
wanted: ['python-configshell', 'python-rtslib', 'targetcli', 'tgt-glusterfs', 'tgt-rbd']
{%- elif name in ('xenial',) %}
wanted: ['python-configshell', 'python-rtslib', 'targetcli']
{%- elif name in ('jessie',) %}
wanted: ['tgt-glusterfs', 'tgt-rbd',]
{%- elif name in ('xenial',) %}
wanted: ['python-configshell', 'tgt', 'python-rtslib', 'targetcli']
{%- else %}
wanted: ['python-configshell-fb', 'tgt', 'tgt-rbd', 'python-rtslib-fb', 'targetcli-fb', 'iscsiuio']
{%- endif %}
{% endmacro %}

{% macro fedora_codename(name, release, codename) %}
{{ codename|default(name, true) }}:
{%- if release in (26, 27,) %}
{%- if release > 26 %}
isns:
pkgs:
wanted:
- isns-utils
- isns-utils-libs
- target-isns
initiator:
pkgs:
wanted:
- iscsi-initiator-utils #cent6/cent7/fedora/amazon
- iscsi-initiator-utils-iscsiuio #cent7/fedora
- libiscsi #cent7/fedora
- libiscsi-utils #cent7/fedora
target:
pkgs:
wanted:
- targetcli
- fcoe-utils
- device-mapper-persistent-data #cent6/cent7/fedora/amazon
- netbsd-iscsi #cent6/cent7/fedora
- yum-plugin-versionlock #cent6/cent7/fedora
- targetcli #cent7/fedora
- libvirt-daemon-driver-storage-iscsi #cent7/fedora
- udisks2-iscsi #cent7/fedora
- scsi-target-utils #cent6/fedora
- fcoe-utils #cent6/fedora
- libvirt-daemon-driver-storage-iscsi-direct #fedora
{%- endif %}
{% endmacro %}

Expand All @@ -65,6 +81,8 @@

## Fedora
# `oscodename` grain has long distro name
{{ fedora_codename('Fedora-30', 30, 'Fedora 30 (Thirty)') }}
{{ fedora_codename('Fedora-29', 29, 'Fedora 29 (Twenty Nine)') }}
{{ fedora_codename('Fedora-28', 28, 'Fedora 28 (Twenty Eight)') }}
{{ fedora_codename('Fedora-27', 27, 'Fedora 27 (Twenty Seven)') }}
{{ fedora_codename('Fedora-26', 26, 'Fedora 26 (Twenty Six)') }}
Expand Down
45 changes: 31 additions & 14 deletions iscsi/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,46 +33,63 @@ Debian:

RedHat:
config:
name:
tgtd: /etc/tgt/targets.conf #cent6
servicename:
open-iscsi: iscsi
isns: isnsd
tgtd: tgtd #cent6
isns:
pkgs:
wanted:
- isns-utils
- yum-plugin-versionlock
# target-isns #fedora29
initiator:
pkgs:
wanted:
- iscsi-initiator-utils
- iscsi-initiator-utils-iscsiuio
- libiscsi
- libiscsi-utils
- iscsi-initiator-utils #cent6/cent7/fedora/amazon
{%- if grains.osmajorrelease >= 7 %}
- iscsi-initiator-utils-iscsiuio #cent7/fedora
- libiscsi #cent7/fedora
- libiscsi-utils #cent7/fedora
{%- endif %}
target:
pkgs:
wanted:
- libvirt-daemon-driver-storage-iscsi
- netbsd-iscsi
- udisks2-iscsi
- yum-plugin-versionlock
- targetcli
- device-mapper-persistent-data
# scsi-target-utils
# fcoe-target-utils
- device-mapper-persistent-data #cent6/cent7/fedora/amazon
{%- if grains.osmajorrelease == 6 %}
- scsi-target-utils #cent6/fedora
- fcoe-utils #cent6/fedora
- fcoe-target-utils #cent6

{%- elif grains.osmajorrelease >= 7 %}
- yum-plugin-versionlock #cent6/cent7/fedora
- targetcli #cent7/fedora
- libvirt-daemon-driver-storage-iscsi #cent7/fedora

{%- if grains.os not in ('Amazon',) %}
- netbsd-iscsi #cent6/cent7/fedora
- udisks2-iscsi #cent7/fedora
{%- endif %}
{%- endif %}

Suse:
config:
servicename:
open-iscsi: iscsid
lio: targetcli ### might need to add suse to oscodename.yaml if SLES support is needed
{%- if grains.osmajorrelease >= 15 %}
lio: targetcli
{%- else %}
lio: target
{%- endif %}
isns:
pkgs:
wanted:
- open-isns
initiator:
pkgs:
wanted:
# libopen-iscsiusr0_2_0
- open-iscsi
- libiscsi8
- librdmacm1
Expand Down

0 comments on commit 55e4cfb

Please sign in to comment.