diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..af0ae18c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +dist: bionic +stages: + - test + - lint + - name: release + if: branch = master AND type != pull_request + +sudo: required +cache: bundler +language: ruby + +services: + - docker + +# Make sure the instances listed below match up with +# the `platforms` defined in `kitchen.yml` +env: + matrix: + - INSTANCE: default-debian-10-develop-py3 + # - INSTANCE: default-ubuntu-1804-develop-py3 + # - INSTANCE: default-centos-7-develop-py3 + # - INSTANCE: default-fedora-30-develop-py3 + # - INSTANCE: default-opensuse-leap-15-develop-py3 + # - INSTANCE: default-amazonlinux-2-develop-py2 + # - INSTANCE: default-debian-9-2019-2-py3 + - INSTANCE: default-ubuntu-1804-2019-2-py3 + # - INSTANCE: default-centos-7-2019-2-py3 + # - INSTANCE: default-fedora-30-2019-2-py3 + # - INSTANCE: default-opensuse-leap-15-2019-2-py3 + - INSTANCE: default-amazonlinux-2-2019-2-py2 + # - INSTANCE: default-debian-9-2018-3-py2 + # - INSTANCE: default-ubuntu-1604-2018-3-py2 + # - INSTANCE: default-centos-7-2018-3-py2 + - INSTANCE: default-fedora-29-2018-3-py2 + - INSTANCE: default-opensuse-leap-15-2018-3-py2 + # - INSTANCE: default-amazonlinux-2-2018-3-py2 + # - INSTANCE: default-debian-8-2017-7-py2 + # - INSTANCE: default-ubuntu-1604-2017-7-py2 + - INSTANCE: default-centos-6-2017-7-py2 + # - INSTANCE: default-fedora-29-2017-7-py2 + # - INSTANCE: default-opensuse-leap-15-2017-7-py2 + # - INSTANCE: default-amazonlinux-2-2017-7-py2 + +script: + - bin/kitchen verify ${INSTANCE} + +jobs: + include: + # Define the `lint` stage (runs `yamllint` and `commitlint`) + - stage: lint + language: node_js + node_js: lts/* + before_install: skip + script: + # Install and run `yamllint` + # Need at least `v1.17.0` for the `yaml-files` setting + - pip install --user yamllint>=1.17.0 + - yamllint -s . + # Install and run `commitlint` + - npm install @commitlint/config-conventional -D + - npm install @commitlint/travis-cli -D + - commitlint-travis + # Define the release stage that runs `semantic-release` + - stage: release + language: node_js + node_js: lts/* + before_install: skip + script: + # Update `AUTHORS.md` + - export MAINTAINER_TOKEN=${GH_TOKEN} + - go get github.com/myii/maintainer + - maintainer contributor + + # Install all dependencies required for `semantic-release` + - npm install @semantic-release/changelog@3 -D + - npm install @semantic-release/exec@3 -D + - npm install @semantic-release/git@7 -D + deploy: + provider: script + skip_cleanup: true + script: + # Run `semantic-release` + - npx semantic-release@15 diff --git a/.yamllint b/.yamllint new file mode 100644 index 00000000..a8509bc8 --- /dev/null +++ b/.yamllint @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +# Extend the `default` configuration provided by `yamllint` +extends: default + +# Files to ignore completely +# 1. All YAML files under directory `node_modules/`, introduced during the Travis run +# 2. Any SLS files under directory `test/`, which are actually state files +ignore: | + node_modules/ + test/**/states/**/*.sls + +yaml-files: + # Default settings + - '*.yaml' + - '*.yml' + - .yamllint + # SaltStack Formulas additional settings + - '*.example' + - test/**/*.sls + +rules: + empty-values: + forbid-in-block-mappings: true + forbid-in-flow-mappings: true + line-length: + # Increase from default of `80` + # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`) + max: 88 diff --git a/iscsi/osfamilymap.yaml b/iscsi/osfamilymap.yaml index 4d5ecb0b..0643e9c6 100644 --- a/iscsi/osfamilymap.yaml +++ b/iscsi/osfamilymap.yaml @@ -34,43 +34,41 @@ Debian: RedHat: config: name: - tgtd: /etc/tgt/targets.conf #cent6 + tgtd: /etc/tgt/targets.conf #cent6 servicename: open-iscsi: iscsi isns: isnsd - tgtd: tgtd #cent6 + tgtd: tgtd #cent6 isns: pkgs: wanted: - isns-utils - yum-plugin-versionlock - # target-isns #fedora29 + # target-isns initiator: pkgs: wanted: - - iscsi-initiator-utils #cent6/cent7/fedora/amazon - {%- if grains.osmajorrelease >= 7 %} - - iscsi-initiator-utils-iscsiuio #cent7/fedora - - libiscsi #cent7/fedora - - libiscsi-utils #cent7/fedora + - iscsi-initiator-utils + {%- if 'osmajorrrelease' in grains and grains.osmajorrelease >= 7 %} + - iscsi-initiator-utils-iscsiuio + - libiscsi + - libiscsi-utils {%- endif %} target: pkgs: wanted: - - 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 + - device-mapper-persistent-data + {%- if 'osmajorrrelease' in grains and grains.osmajorrelease == 6 %} + - scsi-target-utils + - fcoe-utils + - fcoe-target-utils + {%- elif 'osmajorrrelease' in grains and grains.osmajorrelease >= 7 %} + - yum-plugin-versionlock + - targetcli + - libvirt-daemon-driver-storage-iscsi + {%- if 'os' in grains and grains.os not in ('Amazon',) %} + - netbsd-iscsi + - udisks2-iscsi {%- endif %} {%- endif %} @@ -78,11 +76,7 @@ Suse: config: servicename: open-iscsi: iscsid - {%- if grains.osmajorrelease >= 15 %} lio: targetcli - {%- else %} - lio: target - {%- endif %} isns: pkgs: wanted: diff --git a/kitchen.yml b/kitchen.yml index 557a86f4..44a1598b 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -135,7 +135,7 @@ provisioner: log_level: info salt_install: none require_chef: false - formula: template + formula: iscsi salt_copy_filter: - .kitchen - .git @@ -150,42 +150,18 @@ verifier: suites: - name: default - excludes: - - centos-6-2017-7-py2 provisioner: state_top: base: '*': - - template + - iscsi pillars: top.sls: base: '*': - - template - - define_roles + - iscsi pillars_from_files: - template.sls: pillar.example - define_roles.sls: test/salt/pillar/define_roles.sls - verifier: - inspec_tests: - - path: test/integration/default - - name: centos6 - includes: - - centos-6-2017-7-py2 - provisioner: - state_top: - base: - '*': - - template - pillars: - top.sls: - base: - '*': - - template - - define_roles - pillars_from_files: - template.sls: test/salt/pillar/centos6.sls - define_roles.sls: test/salt/pillar/define_roles.sls + iscsi.sls: pillar.example verifier: inspec_tests: - path: test/integration/default