Browse Source

Merge pull request #21 from myii/chore/standardise-structure

fix: debian (avoid `python-ufw`), `amazonlinux-2` & use new pre-salted images
tags/v0.5.4
Imran Iqbal 4 years ago
parent
commit
93cedac856
No account linked to committer's email address
6 changed files with 176 additions and 111 deletions
  1. +34
    -35
      .travis.yml
  2. +88
    -67
      kitchen.yml
  3. +6
    -0
      test/salt/pillar/without-ipv6.sls
  4. +1
    -3
      ufw/osfamilymap.yaml
  5. +35
    -6
      ufw/osfingermap.yaml
  6. +12
    -0
      ufw/package/install.sls

+ 34
- 35
.travis.yml View File

## Machine config ## Machine config
os: 'linux' os: 'linux'
arch: 'amd64' arch: 'amd64'
dist: 'trusty'
dist: 'bionic'
version: '~> 1.0' version: '~> 1.0'


## Language and cache config ## Language and cache config
name: 'Lint: salt-lint, yamllint, shellcheck & commitlint' name: 'Lint: salt-lint, yamllint, shellcheck & commitlint'
before_install: 'skip' before_install: 'skip'
script: script:
# Need to use `pip3` due to using `trusty` on Travis
# [Py2/InsecurePlatformWarning] Tornado requires an up-to-date SSL module.
- sudo apt-get install python3-pip python3-setuptools python3-wheel -y
# Install and run `salt-lint` # Install and run `salt-lint`
- pip3 install --user salt-lint
- pip install --user salt-lint
- git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst' - git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst'
| xargs salt-lint | xargs salt-lint
# Install and run `yamllint` # Install and run `yamllint`
# Need at least `v1.17.0` for the `yaml-files` setting # Need at least `v1.17.0` for the `yaml-files` setting
- pip3 install --user yamllint>=1.17.0
- pip install --user yamllint>=1.17.0
- yamllint -s . - yamllint -s .
# Run `shellcheck` (already pre-installed in Travis) # Run `shellcheck` (already pre-installed in Travis)
- shellcheck --version - shellcheck --version
## Define the rest of the matrix based on Kitchen testing ## Define the rest of the matrix based on Kitchen testing
# Make sure the instances listed below match up with # Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml` # the `platforms` defined in `kitchen.yml`
# - env: INSTANCE=default-debian-10-master-py3
- env: INSTANCE=default-ubuntu-1804-master-py3
# - env: INSTANCE=default-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-debian-10-2019-2-py3
# - env: INSTANCE=default-debian-9-2019-2-py3
# - env: INSTANCE=default-ubuntu-1804-2019-2-py3
# - env: INSTANCE=default-centos-8-2019-2-py3
# - env: INSTANCE=default-fedora-31-2019-2-py3
# - env: INSTANCE=default-opensuse-leap-151-2019-2-py3
# - env: INSTANCE=default-centos-7-2019-2-py2
# - env: INSTANCE=default-amazonlinux-2-2019-2-py3
# - env: INSTANCE=default-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=default-centos-7-2018-3-py2
- env: INSTANCE=default-opensuse-leap-151-2018-3-py2
# - env: INSTANCE=default-amazonlinux-1-2018-3-py2
- env: INSTANCE=default-arch-base-latest-2018-3-py2
# - env: INSTANCE=default-debian-8-2017-7-py2
- env: INSTANCE=default-ubuntu-1604-2017-7-py2
# - env: INSTANCE=default-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=default-arch-base-latest-2017-7-py2
- env: INSTANCE=default-debian-10-master-py3
- env: INSTANCE=without-ipv6-ubuntu-2004-master-py3
# - env: INSTANCE=without-ipv6-ubuntu-1804-master-py3
- env: INSTANCE=default-centos-8-master-py3
- env: INSTANCE=without-ipv6-fedora-32-master-py3
# - env: INSTANCE=without-ipv6-fedora-31-master-py3
# - env: INSTANCE=without-ipv6-opensuse-leap-152-master-py3
# - env: INSTANCE=without-ipv6-amazonlinux-2-master-py3
# - env: INSTANCE=without-ipv6-debian-10-3000-3-py3
# - env: INSTANCE=without-ipv6-debian-9-3000-3-py3
# - env: INSTANCE=without-ipv6-ubuntu-1804-3000-3-py3
# - env: INSTANCE=without-ipv6-centos-8-3000-3-py3
# - env: INSTANCE=without-ipv6-centos-7-3000-3-py3
# - env: INSTANCE=without-ipv6-fedora-31-3000-3-py3
- env: INSTANCE=without-ipv6-opensuse-leap-152-3000-3-py3
- env: INSTANCE=without-ipv6-amazonlinux-2-3000-3-py3
# - env: INSTANCE=without-ipv6-ubuntu-1804-3000-3-py2
# - env: INSTANCE=without-ipv6-ubuntu-1604-3000-3-py2
# - env: INSTANCE=without-ipv6-arch-base-latest-3000-3-py2
# - env: INSTANCE=without-ipv6-debian-10-2019-2-py3
# - env: INSTANCE=without-ipv6-debian-9-2019-2-py3
# - env: INSTANCE=without-ipv6-ubuntu-1804-2019-2-py3
# - env: INSTANCE=without-ipv6-ubuntu-1604-2019-2-py3
# - env: INSTANCE=without-ipv6-centos-8-2019-2-py3
# - env: INSTANCE=without-ipv6-centos-7-2019-2-py3
# - env: INSTANCE=without-ipv6-fedora-31-2019-2-py3
# - env: INSTANCE=without-ipv6-opensuse-leap-152-2019-2-py3
# - env: INSTANCE=without-ipv6-amazonlinux-2-2019-2-py3
# - env: INSTANCE=without-ipv6-centos-6-2019-2-py2
# - env: INSTANCE=without-ipv6-amazonlinux-1-2019-2-py2
- env: INSTANCE=without-ipv6-arch-base-latest-2019-2-py2


## Define the release stage that runs `semantic-release` ## Define the release stage that runs `semantic-release`
- stage: 'release' - stage: 'release'

+ 88
- 67
kitchen.yml View File

- name: debian-10-master-py3 - name: debian-10-master-py3
driver: driver:
image: netmanagers/salt-master-py3:debian-10 image: netmanagers/salt-master-py3:debian-10
- name: ubuntu-2004-master-py3
driver:
image: netmanagers/salt-master-py3:ubuntu-20.04
- name: ubuntu-1804-master-py3 - name: ubuntu-1804-master-py3
driver: driver:
image: netmanagers/salt-master-py3:ubuntu-18.04 image: netmanagers/salt-master-py3:ubuntu-18.04
- name: centos-8-master-py3 - name: centos-8-master-py3
driver: driver:
image: netmanagers/salt-master-py3:centos-8 image: netmanagers/salt-master-py3:centos-8
- name: fedora-32-master-py3
driver:
image: netmanagers/salt-master-py3:fedora-32
- name: fedora-31-master-py3 - name: fedora-31-master-py3
driver: driver:
image: netmanagers/salt-master-py3:fedora-31 image: netmanagers/salt-master-py3:fedora-31
- name: opensuse-leap-151-master-py3
- name: opensuse-leap-152-master-py3
driver: driver:
image: netmanagers/salt-master-py3:opensuse-leap-15.1
image: netmanagers/salt-master-py3:opensuse-leap-15.2
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
# Workaround to avoid intermittent failures on `opensuse-leap-15.2`:
# => SCP did not finish successfully (255): (Net::SCP::Error) # => SCP did not finish successfully (255): (Net::SCP::Error)
transport: transport:
max_ssh_sessions: 1 max_ssh_sessions: 1
driver: driver:
image: netmanagers/salt-master-py3:amazonlinux-2 image: netmanagers/salt-master-py3:amazonlinux-2


## SALT `2019.2`
- name: debian-10-2019-2-py3
## SALT `3000.3`
- name: debian-10-3000-3-py3
driver: driver:
image: netmanagers/salt-2019.2-py3:debian-10
- name: debian-9-2019-2-py3
image: netmanagers/salt-3000.3-py3:debian-10
- name: debian-9-3000-3-py3
driver: driver:
image: netmanagers/salt-2019.2-py3:debian-9
- name: ubuntu-1804-2019-2-py3
image: netmanagers/salt-3000.3-py3:debian-9
- name: ubuntu-1804-3000-3-py3
driver: driver:
image: netmanagers/salt-2019.2-py3:ubuntu-18.04
- name: centos-8-2019-2-py3
image: netmanagers/salt-3000.3-py3:ubuntu-18.04
- name: centos-8-3000-3-py3
driver: driver:
image: netmanagers/salt-2019.2-py3:centos-8
- name: fedora-31-2019-2-py3
image: netmanagers/salt-3000.3-py3:centos-8
- name: centos-7-3000-3-py3
driver: driver:
image: netmanagers/salt-2019.2-py3:fedora-31
- name: opensuse-leap-151-2019-2-py3
image: netmanagers/salt-3000.3-py3:centos-7
- name: fedora-31-3000-3-py3
driver:
image: netmanagers/salt-3000.3-py3:fedora-31
- name: opensuse-leap-152-3000-3-py3
driver: driver:
image: netmanagers/salt-2019.2-py3:opensuse-leap-15.1
image: netmanagers/salt-3000.3-py3:opensuse-leap-15.2
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
# Workaround to avoid intermittent failures on `opensuse-leap-15.2`:
# => SCP did not finish successfully (255): (Net::SCP::Error) # => SCP did not finish successfully (255): (Net::SCP::Error)
transport: transport:
max_ssh_sessions: 1 max_ssh_sessions: 1
- name: centos-7-2019-2-py2
- name: amazonlinux-2-3000-3-py3
driver: driver:
image: netmanagers/salt-2019.2-py2:centos-7
- name: amazonlinux-2-2019-2-py3
image: netmanagers/salt-3000.3-py3:amazonlinux-2
- name: ubuntu-1804-3000-3-py2
driver: driver:
image: netmanagers/salt-2019.2-py3:amazonlinux-2
- name: arch-base-latest-2019-2-py2
image: netmanagers/salt-3000.3-py2:ubuntu-18.04
- name: ubuntu-1604-3000-3-py2
driver: driver:
image: netmanagers/salt-2019.2-py2:arch-base-latest
image: netmanagers/salt-3000.3-py2:ubuntu-16.04
- name: arch-base-latest-3000-3-py2
driver:
image: netmanagers/salt-3000.3-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd


## SALT `2018.3`
- name: fedora-30-2018-3-py3
driver:
image: netmanagers/salt-2018.3-py3:fedora-30
- name: debian-9-2018-3-py2
driver:
image: netmanagers/salt-2018.3-py2:debian-9
- name: ubuntu-1604-2018-3-py2
driver:
image: netmanagers/salt-2018.3-py2:ubuntu-16.04
- name: centos-7-2018-3-py2
driver:
image: netmanagers/salt-2018.3-py2:centos-7
- name: opensuse-leap-151-2018-3-py2
## SALT `2019.2`
- name: debian-10-2019-2-py3
driver: driver:
image: netmanagers/salt-2018.3-py2:opensuse-leap-15.1
run_command: /usr/lib/systemd/systemd
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
# => SCP did not finish successfully (255): (Net::SCP::Error)
transport:
max_ssh_sessions: 1
- name: amazonlinux-1-2018-3-py2
image: netmanagers/salt-2019.2-py3:debian-10
- name: debian-9-2019-2-py3
driver: driver:
image: netmanagers/salt-2018.3-py2:amazonlinux-1
run_command: /sbin/init
- name: arch-base-latest-2018-3-py2
image: netmanagers/salt-2019.2-py3:debian-9
- name: ubuntu-1804-2019-2-py3
driver: driver:
image: netmanagers/salt-2018.3-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd

## SALT `2017.7`
- name: debian-8-2017-7-py2
image: netmanagers/salt-2019.2-py3:ubuntu-18.04
- name: ubuntu-1604-2019-2-py3
driver: driver:
image: netmanagers/salt-2017.7-py2:debian-8
- name: ubuntu-1604-2017-7-py2
image: netmanagers/salt-2019.2-py3:ubuntu-16.04
- name: centos-8-2019-2-py3
driver: driver:
image: netmanagers/salt-2017.7-py2:ubuntu-16.04
- name: centos-6-2017-7-py2
image: netmanagers/salt-2019.2-py3:centos-8
- name: centos-7-2019-2-py3
driver: driver:
image: netmanagers/salt-2017.7-py2:centos-6
run_command: /sbin/init
- name: fedora-30-2017-7-py2
image: netmanagers/salt-2019.2-py3:centos-7
- name: fedora-31-2019-2-py3
driver: driver:
image: netmanagers/salt-2017.7-py2:fedora-30
- name: opensuse-leap-151-2017-7-py2
image: netmanagers/salt-2019.2-py3:fedora-31
- name: opensuse-leap-152-2019-2-py3
driver: driver:
image: netmanagers/salt-2017.7-py2:opensuse-leap-15.1
image: netmanagers/salt-2019.2-py3:opensuse-leap-15.2
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
# Workaround to avoid intermittent failures on `opensuse-leap-15.2`:
# => SCP did not finish successfully (255): (Net::SCP::Error) # => SCP did not finish successfully (255): (Net::SCP::Error)
transport: transport:
max_ssh_sessions: 1 max_ssh_sessions: 1
- name: amazonlinux-1-2017-7-py2
- name: amazonlinux-2-2019-2-py3
driver:
image: netmanagers/salt-2019.2-py3:amazonlinux-2
- name: centos-6-2019-2-py2
driver:
image: netmanagers/salt-2019.2-py2:centos-6
run_command: /sbin/init
- name: amazonlinux-1-2019-2-py2
driver: driver:
image: netmanagers/salt-2017.7-py2:amazonlinux-1
image: netmanagers/salt-2019.2-py2:amazonlinux-1
run_command: /sbin/init run_command: /sbin/init
- name: arch-base-latest-2017-7-py2
- name: arch-base-latest-2019-2-py2
driver: driver:
image: netmanagers/salt-2017.7-py2:arch-base-latest
image: netmanagers/salt-2019.2-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd


provisioner: provisioner:


suites: suites:
- name: default - name: default
includes:
- debian-10-master-py3
- centos-8-master-py3
provisioner:
state_top:
base:
'*':
- ufw
pillars:
top.sls:
base:
'*':
- ufw
pillars_from_files:
ufw.sls: test/salt/pillar/default.sls
verifier:
inspec_tests:
- path: test/integration/default
- name: without-ipv6
excludes:
- debian-10-master-py3
- centos-8-master-py3
provisioner: provisioner:
state_top: state_top:
base: base:
base: base:
'*': '*':
- ufw - ufw
- without-ipv6
pillars_from_files: pillars_from_files:
ufw.sls: test/salt/pillar/default.sls ufw.sls: test/salt/pillar/default.sls
without-ipv6.sls: test/salt/pillar/without-ipv6.sls
verifier: verifier:
inspec_tests: inspec_tests:
- path: test/integration/default - path: test/integration/default

+ 6
- 0
test/salt/pillar/without-ipv6.sls View File

# -*- coding: utf-8 -*-
# vim: ft=yaml
---
ufw:
settings:
ipv6: false

+ 1
- 3
ufw/osfamilymap.yaml View File

# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: ft=yaml # vim: ft=yaml
--- ---
Debian:
packages:
- python-ufw
Debian: {}
RedHat: {} RedHat: {}
Suse: Suse:
packages: packages:

+ 35
- 6
ufw/osfingermap.yaml View File

# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: ft=yaml # vim: ft=yaml
--- ---
Debian-8: {}
# os: Debian
Debian-10: {}
Debian-9: {} Debian-9: {}
Ubuntu-16.04: {}
Debian-8:
packages:
- python-ufw

# os: Ubuntu
Ubuntu-20.04: {}
Ubuntu-18.04: {} Ubuntu-18.04: {}
Fedora-28: {}
Fedora-29: {}
CentOS-7: {}
Ubuntu-16.04:
packages:
- python-ufw

# os: Fedora
Fedora-32: {}
Fedora-31: {}

# os: CentOS
CentOS Linux-8: {}
CentOS Linux-7: {}
CentOS-6: {} CentOS-6: {}
openSUSE-4.23: {}

# os: Amazon
Amazon Linux-2: {}
Amazon Linux AMI-2018: {}

# os: SUSE
Leap-15: {}

# os: FreeBSD
FreeBSD-12: {}

# os: Windows
Windows-8.1: {}

# os: Gentoo
Gentoo-2: {}

+ 12
- 0
ufw/package/install.sls View File

{%- from tplroot ~ "/map.jinja" import ufw with context %} {%- from tplroot ~ "/map.jinja" import ufw with context %}


ufw-package-install-pkg-installed: ufw-package-install-pkg-installed:
{%- if grains.get('osfinger', '') == 'Amazon Linux-2' %}
pkgrepo.managed:
- name: epel
- humanname: Extra Packages for Enterprise Linux 7 - $basearch
- mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
- enabled: 1
- gpgcheck: 1
- gpgkey: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
- failovermethod: priority
- require_in:
- pkg: ufw-package-install-pkg-installed
{%- endif %}
pkg.installed: pkg.installed:
- name: {{ ufw.package }} - name: {{ ufw.package }}



Loading…
Cancel
Save