Skip to content

Commit

Permalink
Merge pull request #35 from noelmcloughlin/ci
Browse files Browse the repository at this point in the history
fix(travis): fixes for Archlinux and CentOS
  • Loading branch information
noelmcloughlin authored May 8, 2020
2 parents 6c578a1 + f78b48f commit a687bb8
Show file tree
Hide file tree
Showing 14 changed files with 756 additions and 58 deletions.
30 changes: 15 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,35 +58,35 @@ jobs:
## Define the rest of the matrix based on Kitchen testing
# Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml`
- env: INSTANCE=default-debian-10-master-py3
# - env: INSTANCE=default-ubuntu-1804-master-py3
# - env: INSTANCE=centarch-centos-8-master-py3
# - env: INSTANCE=default-debian-10-master-py3
- env: INSTANCE=default-ubuntu-1804-master-py3
- env: INSTANCE=centos-centos-8-master-py3
# - env: INSTANCE=default-fedora-31-master-py3
# - env: INSTANCE=default-opensuse-leap-151-master-py3
# - env: INSTANCE=default-amazonlinux-2-master-py3
- env: INSTANCE=default-opensuse-leap-151-master-py3
- env: INSTANCE=default-amazonlinux-2-master-py3
# - env: INSTANCE=default-debian-10-2019-2-py3
# - env: INSTANCE=default-debian-9-2019-2-py3
- env: INSTANCE=default-ubuntu-1804-2019-2-py3
# - env: INSTANCE=centarch-centos-8-2019-2-py3
# - env: INSTANCE=default-ubuntu-1804-2019-2-py3
# - env: INSTANCE=centos-centos-8-2019-2-py3
# - env: INSTANCE=default-fedora-31-2019-2-py3
- env: INSTANCE=default-opensuse-leap-151-2019-2-py3
# - env: INSTANCE=centarch-centos-7-2019-2-py2
- env: INSTANCE=default-amazonlinux-2-2019-2-py3
# - env: INSTANCE=centarch-arch-base-latest-2019-2-py2
# - env: INSTANCE=default-opensuse-leap-151-2019-2-py3
# - env: INSTANCE=centos-centos-7-2019-2-py2
# - env: INSTANCE=default-amazonlinux-2-2019-2-py3
- env: INSTANCE=arch-arch-base-latest-2019-2-py2
# - env: INSTANCE=default-fedora-30-2018-3-py3
# - env: INSTANCE=default-debian-9-2018-3-py2
# - env: INSTANCE=default-ubuntu-1604-2018-3-py2
# - env: INSTANCE=centarch-centos-7-2018-3-py2
# - env: INSTANCE=centos-centos-7-2018-3-py2
# - env: INSTANCE=default-opensuse-leap-151-2018-3-py2
# - env: INSTANCE=default-amazonlinux-1-2018-3-py2
- env: INSTANCE=centarch-arch-base-latest-2018-3-py2
- env: INSTANCE=arch-arch-base-latest-2018-3-py2
# - env: INSTANCE=default-debian-8-2017-7-py2
# - env: INSTANCE=default-ubuntu-1604-2017-7-py2
# - env: INSTANCE=centarch-centos-6-2017-7-py2
# - env: INSTANCE=centos-centos-6-2017-7-py2
# - env: INSTANCE=default-fedora-30-2017-7-py2
# - env: INSTANCE=default-opensuse-leap-151-2017-7-py2
# - env: INSTANCE=default-amazonlinux-1-2017-7-py2
# - env: INSTANCE=centarch-arch-base-latest-2017-7-py2
# - env: INSTANCE=arch-arch-base-latest-2017-7-py2

## Define the release stage that runs `semantic-release`
- stage: 'release'
Expand Down
17 changes: 10 additions & 7 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,23 @@ which contains the currently released version. This formula is versioned accordi

See `Formula Versioning Section <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#versioning>`_ for more details.

Contributing to this repo
-------------------------

**Commit message formatting is significant!!**
Special Nodes
-------------

Please see `How to contribute <https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst>`_ for more details.
The scope of this formula is Ethernet/Block

Scope = Ethernet/Block
----------------------
.. image:: link-transport-storage-protocols.png
:target: https://github.com/saltstack-formulas/iscsi-formula
:scale: 15 %
:alt: Link/Transport and Storage protocol infographic

Contributing to this repo
-------------------------

**Commit message formatting is significant!!**

Please see `How to contribute <https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst>`_ for more details.

Available Meta states
---------------------

Expand Down
27 changes: 21 additions & 6 deletions iscsi/initiator/service/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,19 @@ iscsi-initiator-service-install-file-line-freebsd:
iscsi-initiator-service-install-service-running:
{%- if not iscsi.initiator.enabled %}
service.dead:
{%- if servicename is iterable and servicename is not string %}
- names: {{ servicename|json }}
{%- else %}
- name: {{ servicename }}
{%- endif %}
- enable: False
{%- else %}
service.running:
{%- if servicename is iterable and servicename is not string %}
- names: {{ servicename|json }}
{%- else %}
- name: {{ servicename }}
{%- endif %}
- enable: True
- onfail_in:
- test: iscsi-initiator-service-install-check-status
Expand All @@ -44,24 +52,31 @@ iscsi-initiator-service-install-service-running:
- file: iscsi-initiator-config-install-file-managed
{%- endif %}
{%- endif %}
{%- if servicename is iterable and servicename is not string %}
- names: {{ servicename|json }}
{%- else %}
- name: {{ servicename }}
{%- endif %}
iscsi-initiator-service-install-check-status:
test.show_notification:
- text: |
In certain circumstances the iscsi initiator service will not start.
* your configuration file may be incorrect.
* your kernel was upgraded but not activated by reboot
{%- if servicename is iterable and servicename is not string %}
{%- for svc in servicename %}
'systemctl enable {{ svc }}' && reboot
{%- endfor %}
{%- else %}
'systemctl enable {{ servicename }}' && reboot
- unless: {{ grains.os_family in ('MacOS', 'Windows') }} #maybe not needed but no harm
{%- endif %}
cmd.run:
- names:
{%- if servicename is iterable and servicename is not string %}
{%- for svc in servicename %}
- journalctl -xe -u {{ svc }} || true
- systemctl status {{ svc }} -l || true
{%- endfor %}
{%- else %}
- journalctl -xe -u {{ servicename }} || true
- systemctl status {{ servicename }} -l || true
{%- endif %}
- /sbin/lsmod 2>/dev/null || true
- ls /var/lib/iscsi/nodes 2>/dev/null || true
- ls /sys/class/iscsi_session 2>/dev/null || true
Expand Down
14 changes: 13 additions & 1 deletion iscsi/isns/service/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,22 @@ iscsi-isns-service-install-check-status:
In certain circumstances the iscsi isns service will not start.
* your configuration file may be incorrect.
* your kernel was upgraded but not activated by reboot
{%- if servicename is iterable and servicename is not string %}
{%- for svc in servicename %}
'systemctl enable {{ svc }}' && reboot
{%- endfor %}
{%- else %}
'systemctl enable {{ servicename }}' && reboot
- unless: {{ grains.os_family in ('MacOS', 'Windows') }} #maybe not needed but no harm
{%- endif %}
cmd.run:
- names:
{%- if servicename is iterable and servicename is not string %}
{%- for svc in servicename %}
- journalctl -xe -u {{ svc }} || true
- systemctl status {{ svc }} -l || true
{%- endfor %}
{%- else %}
- journalctl -xe -u {{ servicename }} || true
- systemctl status {{ servicename }} -l || true
{%- endif %}
- onlyif: test -x /usr/bin/systemctl || test -x /bin/systemctl || test -x /sbin/systemctl
6 changes: 4 additions & 2 deletions iscsi/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ RedHat:
pkgs:
wanted:
- isns-utils
- yum-plugin-versionlock
initiator:
pkgs:
wanted:
Expand Down Expand Up @@ -112,6 +111,7 @@ Arch:
initiator:
pkgs:
wanted:
- file
- binutils
- fakeroot
- open-iscsi
Expand All @@ -124,10 +124,12 @@ Arch:
loadmodule: true
pkgs:
wanted:
- file
- python-urwid
- binutils
- fakeroot
- linux-lts # For kernel scsi modules
- python-pip # makepkg states needs 'gitpython'.
# python-pip # makepkg states needs 'gitpython'.
- thin-provisioning-tools
make:
gitrepo: https://aur.archlinux.org
Expand Down
9 changes: 8 additions & 1 deletion iscsi/osfingermap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
---
# os: CentOS
CentOS-6:
isns:
pkgs:
wanted:
- yum-plugin-versionlock
target:
provider: tgtd
pkgs:
Expand All @@ -26,6 +30,10 @@ CentOS-6:
tgtd: tgtd

CentOS-7:
isns:
pkgs:
wanted:
- yum-plugin-versionlock
initiator:
pkgs:
wanted:
Expand Down Expand Up @@ -56,7 +64,6 @@ CentOS-8:
loadmodule: true
pkgs:
wanted:
- yum-plugin-versionlock
- targetcli
- libvirt-daemon-driver-storage-iscsi
- libvirt-daemon-driver-storage-iscsi-direct
Expand Down
3 changes: 0 additions & 3 deletions iscsi/osmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,9 @@ CentOS:
pkgs:
wanted:
- device-mapper-persistent-data
- netbsd-iscsi
- yum-plugin-versionlock
- targetcli
- libvirt-daemon-driver-storage-iscsi
- udisks2-iscsi
- scsi-target-utils
- fcoe-utils

# os_family: Suse
Expand Down
17 changes: 15 additions & 2 deletions iscsi/target/make/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,26 @@ iscsi-target-make-{{ pkg }}-git-latest:
- require:
- file: iscsi-target-make-file-directory
{# workaround https://github.com/saltstack-formulas/iscsi-formula/issues/34 #}
{%- if pkg == 'python-configshell-fb' %}
{%- for file in ('.SRCINFO', 'pkg/python2-configshell-fb/.PKGINFO', 'PKGBUILD') %}
iscsi-target-make-{{ pkg }}-workaround-{{ file }}:
file.replace:
- name: /home/{{ iscsi.user }}/{{ pkg }}/{{ file }}
- onlyif: test -f /home/{{ iscsi.user }}/{{ pkg }}/{{ file }}
- pattern: python2-urwid
- repl: python-urwid
- require_in:
- cmd: iscsi-target-make-{{ pkg }}-cmd-run
{%- endfor %}
{%- endif %}
iscsi-target-make-{{ pkg }}-cmd-run:
cmd.run:
- cwd: /home/{{ iscsi.user }}/{{ pkg }}
- name: {{ iscsi.target.make.cmd }}
- runas: {{ iscsi.user }}
- onchanges:
- git: iscsi-target-make-{{ pkg }}-git-latest
- require:
- git: iscsi-target-make-{{ pkg }}-git-latest
- require_in:
Expand Down
29 changes: 22 additions & 7 deletions iscsi/target/service/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ iscsi-target-service-install-file-line-freebsd:
iscsi-target-service-install-service-running:
{%- if not iscsi.target.enabled %}
service.dead:
{%- if servicename is iterable and servicename is not string %}
- names: {{ servicename|json }}
{%- else %}
- name: {{ servicename }}
{%- endif %}
- enable: False
{%- else %}
service.running:
{%- if servicename is iterable and servicename is not string %}
- names: {{ servicename|json }}
{%- else %}
- name: {{ servicename }}
{%- endif %}
- enable: True
- onfail_in:
- test: iscsi-target-service-install-check-status
Expand All @@ -46,11 +54,6 @@ iscsi-target-service-install-service-running:
- file: iscsi-target-config-install-file-managed
{%- endif %}
{%- endif %}
{%- if servicename is iterable and servicename is not string %}
- names: {{ servicename|json }}
{%- else %}
- name: {{ servicename }}
{%- endif %}
- unless: {{ grains.os in ('Amazon', 'MacOS') }}
- onlyif: {{ iscsi.target.enabled }}
Expand All @@ -60,12 +63,24 @@ iscsi-target-service-install-check-status:
In certain circumstances the iscsi target service will not start.
* your configuration file may be incorrect.
* your kernel was upgraded but not activated by reboot
{%- if servicename is iterable and servicename is not string %}
{%- for svc in servicename %}
'systemctl enable {{ svc }}' && reboot
{%- endfor %}
{%- else %}
'systemctl enable {{ servicename }}' && reboot
- unless: {{ grains.os_family in ('MacOS', 'Windows') }} #maybe not needed but no harm
{%- endif %}
cmd.run:
- names:
- echo "-- {{ iscsi.target.enabled }} --"
{%- if servicename is iterable and servicename is not string %}
{%- for svc in servicename %}
- journalctl -xe -u {{ svc }} || true
- systemctl status {{ svc }} -l || true
{%- endfor %}
{%- else %}
- journalctl -xe -u {{ servicename }} || true
- systemctl status {{ servicename }} -l || true
{%- endif %}
- echo "--enabled? {{ iscsi.target.enabled }} --"
- /sbin/lsmod 2>/dev/null || true
- onlyif: test -x /usr/bin/systemctl || test -x /bin/systemctl || test -x /sbin/systemctl
35 changes: 31 additions & 4 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,42 @@ suites:
verifier:
inspec_tests:
- path: test/integration/default
- name: centarch
- name: centos
includes:
- centos-8-master-py3
- centos-8-2019-2-py3
- centos-7-2019-2-py2
- arch-base-latest-2019-2-py2
- centos-7-2018-3-py2
- arch-base-latest-2018-3-py2
- centos-6-2017-7-py2
provisioner:
state_top:
base:
'*':
- lvm.install
- lvm.files.create
- lvm.pv.create
- iscsi
- iscsi.clean
pillars:
top.sls:
base:
'*':
- lvm
- iscsi
pillars_from_files:
lvm.sls: test/salt/pillar/lvm.centos
iscsi.sls: test/salt/pillar/pillar.centos
dependencies:
- name: lvm
repo: git
source: https://github.com/saltstack-formulas/lvm-formula.git
verifier:
inspec_tests:
- path: test/integration/default
- name: arch
includes:
- arch-base-latest-2019-2-py2
- arch-base-latest-2018-3-py2
- arch-base-latest-2017-7-py2
provisioner:
state_top:
Expand All @@ -216,7 +243,7 @@ suites:
pillars_from_files:
users.sls: test/salt/pillar/users.arch
lvm.sls: test/salt/pillar/lvm.example
iscsi.sls: test/salt/pillar/pillar.travis
iscsi.sls: test/salt/pillar/pillar.arch
dependencies:
- name: users
repo: git
Expand Down
Loading

0 comments on commit a687bb8

Please sign in to comment.