From 3ebb3542cb7d597358fbacd936dbd1514472948d Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Wed, 1 Apr 2020 04:42:03 +0100 Subject: [PATCH 1/2] ci(kitchen+travis): adjust matrix to add `3000` & remove `2017.7` * Automated using https://github.com/myii/ssf-formula/pull/144 --- .travis.yml | 36 +++++++++++--------- kitchen.yml | 94 +++++++++++++++++++++++++++++++---------------------- 2 files changed, 77 insertions(+), 53 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0fc2515..79c9ac1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,34 +60,40 @@ jobs: # 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-centos-8-master-py3 # - env: INSTANCE=default-fedora-31-master-py3 # - env: INSTANCE=suse-opensuse-leap-151-master-py3 # - env: INSTANCE=default-amazonlinux-2-master-py3 # - env: INSTANCE=default-arch-base-latest-master-py2 + # - env: INSTANCE=default-debian-10-3000-py3 + - env: INSTANCE=default-ubuntu-1804-3000-py3 + # - env: INSTANCE=default-centos-8-3000-py3 + # - env: INSTANCE=default-fedora-31-3000-py3 + - env: INSTANCE=suse-opensuse-leap-151-3000-py3 + - env: INSTANCE=default-amazonlinux-2-3000-py3 + # - env: INSTANCE=default-arch-base-latest-3000-py2 # - 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-ubuntu-1804-2019-2-py3 + # - env: INSTANCE=default-ubuntu-1604-2019-2-py3 # - env: INSTANCE=default-centos-8-2019-2-py3 - # - env: INSTANCE=default-fedora-31-2019-2-py3 - - env: INSTANCE=suse-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-centos-7-2019-2-py3 + - env: INSTANCE=default-fedora-31-2019-2-py3 + # - env: INSTANCE=suse-opensuse-leap-151-2019-2-py3 + # - env: INSTANCE=default-amazonlinux-2-2019-2-py3 + # - env: INSTANCE=default-ubuntu-1804-2019-2-py2 + # - env: INSTANCE=default-amazonlinux-1-2019-2-py2 # - env: INSTANCE=default-arch-base-latest-2019-2-py2 - - env: INSTANCE=default-fedora-30-2018-3-py3 + # - env: INSTANCE=default-centos-7-2018-3-py3 + # - env: INSTANCE=default-fedora-30-2018-3-py3 # - env: INSTANCE=default-debian-9-2018-3-py2 + # - env: INSTANCE=default-debian-8-2018-3-py2 + # - env: INSTANCE=default-ubuntu-1804-2018-3-py2 # - env: INSTANCE=default-ubuntu-1604-2018-3-py2 - # - env: INSTANCE=default-centos-7-2018-3-py2 + # - env: INSTANCE=default-centos-6-2018-3-py2 # - env: INSTANCE=suse-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=suse-opensuse-leap-151-2017-7-py2 - # - env: INSTANCE=default-amazonlinux-1-2017-7-py2 - # - env: INSTANCE=default-arch-base-latest-2017-7-py2 ## Define the release stage that runs `semantic-release` - stage: 'release' diff --git a/kitchen.yml b/kitchen.yml index d5458f5..bb07a95 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -40,6 +40,35 @@ platforms: image: netmanagers/salt-master-py2:arch-base-latest run_command: /usr/lib/systemd/systemd + ## SALT `3000` + - name: debian-10-3000-py3 + driver: + image: netmanagers/salt-3000-py3:debian-10 + - name: ubuntu-1804-3000-py3 + driver: + image: netmanagers/salt-3000-py3:ubuntu-18.04 + - name: centos-8-3000-py3 + driver: + image: netmanagers/salt-3000-py3:centos-8 + - name: fedora-31-3000-py3 + driver: + image: netmanagers/salt-3000-py3:fedora-31 + - name: opensuse-leap-151-3000-py3 + driver: + image: netmanagers/salt-3000-py3: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-2-3000-py3 + driver: + image: netmanagers/salt-3000-py3:amazonlinux-2 + - name: arch-base-latest-3000-py2 + driver: + image: netmanagers/salt-3000-py2:arch-base-latest + run_command: /usr/lib/systemd/systemd + ## SALT `2019.2` - name: debian-10-2019-2-py3 driver: @@ -50,9 +79,15 @@ platforms: - name: ubuntu-1804-2019-2-py3 driver: image: netmanagers/salt-2019.2-py3:ubuntu-18.04 + - name: ubuntu-1604-2019-2-py3 + driver: + image: netmanagers/salt-2019.2-py3:ubuntu-16.04 - name: centos-8-2019-2-py3 driver: image: netmanagers/salt-2019.2-py3:centos-8 + - name: centos-7-2019-2-py3 + driver: + image: netmanagers/salt-2019.2-py3:centos-7 - name: fedora-31-2019-2-py3 driver: image: netmanagers/salt-2019.2-py3:fedora-31 @@ -64,30 +99,44 @@ platforms: # => SCP did not finish successfully (255): (Net::SCP::Error) transport: max_ssh_sessions: 1 - - name: centos-7-2019-2-py2 - driver: - image: netmanagers/salt-2019.2-py2:centos-7 - name: amazonlinux-2-2019-2-py3 driver: image: netmanagers/salt-2019.2-py3:amazonlinux-2 + - name: ubuntu-1804-2019-2-py2 + driver: + image: netmanagers/salt-2019.2-py2:ubuntu-18.04 + - name: amazonlinux-1-2019-2-py2 + driver: + image: netmanagers/salt-2019.2-py2:amazonlinux-1 + run_command: /sbin/init - name: arch-base-latest-2019-2-py2 driver: image: netmanagers/salt-2019.2-py2:arch-base-latest run_command: /usr/lib/systemd/systemd ## SALT `2018.3` + - name: centos-7-2018-3-py3 + driver: + image: netmanagers/salt-2018.3-py3:centos-7 - 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: debian-8-2018-3-py2 + driver: + image: netmanagers/salt-2018.3-py2:debian-8 + - name: ubuntu-1804-2018-3-py2 + driver: + image: netmanagers/salt-2018.3-py2:ubuntu-18.04 - name: ubuntu-1604-2018-3-py2 driver: image: netmanagers/salt-2018.3-py2:ubuntu-16.04 - - name: centos-7-2018-3-py2 + - name: centos-6-2018-3-py2 driver: - image: netmanagers/salt-2018.3-py2:centos-7 + image: netmanagers/salt-2018.3-py2:centos-6 + run_command: /sbin/init - name: opensuse-leap-151-2018-3-py2 driver: image: netmanagers/salt-2018.3-py2:opensuse-leap-15.1 @@ -105,37 +154,6 @@ platforms: image: netmanagers/salt-2018.3-py2:arch-base-latest run_command: /usr/lib/systemd/systemd - ## SALT `2017.7` - - name: debian-8-2017-7-py2 - driver: - image: netmanagers/salt-2017.7-py2:debian-8 - - name: ubuntu-1604-2017-7-py2 - driver: - image: netmanagers/salt-2017.7-py2:ubuntu-16.04 - - name: centos-6-2017-7-py2 - driver: - image: netmanagers/salt-2017.7-py2:centos-6 - run_command: /sbin/init - - name: fedora-30-2017-7-py2 - driver: - image: netmanagers/salt-2017.7-py2:fedora-30 - - name: opensuse-leap-151-2017-7-py2 - driver: - image: netmanagers/salt-2017.7-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-2017-7-py2 - driver: - image: netmanagers/salt-2017.7-py2:amazonlinux-1 - run_command: /sbin/init - - name: arch-base-latest-2017-7-py2 - driver: - image: netmanagers/salt-2017.7-py2:arch-base-latest - run_command: /usr/lib/systemd/systemd - provisioner: name: salt_solo log_level: debug @@ -158,9 +176,9 @@ suites: - name: default excludes: - opensuse-leap-151-master-py3 + - opensuse-leap-151-3000-py3 - opensuse-leap-151-2019-2-py3 - opensuse-leap-151-2018-3-py2 - - opensuse-leap-151-2017-7-py2 provisioner: state_top: base: @@ -181,9 +199,9 @@ suites: - name: suse includes: - opensuse-leap-151-master-py3 + - opensuse-leap-151-3000-py3 - opensuse-leap-151-2019-2-py3 - opensuse-leap-151-2018-3-py2 - - opensuse-leap-151-2017-7-py2 provisioner: state_top: base: From 90bd91c43f98a82df025fb73a34c12c2f6c26b1e Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 31 Mar 2020 23:46:39 +0100 Subject: [PATCH 2/2] feat(ng): add `retry_options` to fix installation on `centos-8` --- .travis.yml | 4 ++-- pillar.example | 7 +++++++ test/salt/pillar/default.sls | 5 +++++ varnish/ng/install.sls | 3 +++ varnish/ng/repo.sls | 6 ++++++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 79c9ac1..ff19435 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,14 +62,14 @@ jobs: # - env: INSTANCE=default-ubuntu-1804-master-py3 - env: INSTANCE=default-centos-8-master-py3 # - env: INSTANCE=default-fedora-31-master-py3 - # - env: INSTANCE=suse-opensuse-leap-151-master-py3 + - env: INSTANCE=suse-opensuse-leap-151-master-py3 # - env: INSTANCE=default-amazonlinux-2-master-py3 # - env: INSTANCE=default-arch-base-latest-master-py2 # - env: INSTANCE=default-debian-10-3000-py3 - env: INSTANCE=default-ubuntu-1804-3000-py3 # - env: INSTANCE=default-centos-8-3000-py3 # - env: INSTANCE=default-fedora-31-3000-py3 - - env: INSTANCE=suse-opensuse-leap-151-3000-py3 + # - env: INSTANCE=suse-opensuse-leap-151-3000-py3 - env: INSTANCE=default-amazonlinux-2-3000-py3 # - env: INSTANCE=default-arch-base-latest-3000-py2 # - env: INSTANCE=default-debian-10-2019-2-py3 diff --git a/pillar.example b/pillar.example index edd932c..e7dc2f5 100644 --- a/pillar.example +++ b/pillar.example @@ -84,3 +84,10 @@ varnish: source_path: salt://testing/mobile_detect.vcl varnishncsa: enabled: true # Manage varnishncsa service + + # https://docs.saltstack.com/en/latest/ref/states/requisites.html#retrying-states + retry_options: + attempts: 3 + until: true + interval: 15 + splay: 15 diff --git a/test/salt/pillar/default.sls b/test/salt/pillar/default.sls index 55ac189..2862497 100644 --- a/test/salt/pillar/default.sls +++ b/test/salt/pillar/default.sls @@ -13,3 +13,8 @@ varnish: -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,100m + retry_options: + attempts: 3 + until: true + interval: 5 + splay: 5 diff --git a/varnish/ng/install.sls b/varnish/ng/install.sls index bd32977..456807a 100644 --- a/varnish/ng/install.sls +++ b/varnish/ng/install.sls @@ -6,3 +6,6 @@ varnish.install: pkg.installed: - name: {{ varnish_settings.pkg }} + {%- if varnish_settings.get('retry_options', {}) %} + - retry: {{ varnish_settings.retry_options | json }} + {%- endif %} diff --git a/varnish/ng/repo.sls b/varnish/ng/repo.sls index 949c0b8..1ef2eec 100644 --- a/varnish/ng/repo.sls +++ b/varnish/ng/repo.sls @@ -11,6 +11,9 @@ varnish.repo.dependencies: - pkgs: - apt-transport-https - python{{ pkg_dep_pyver }}-apt + {%- if varnish_settings.get('retry_options', {}) %} + - retry: {{ varnish_settings.retry_options | json }} + {%- endif %} - require_in: - pkgrepo: varnish.repo.{{ varnish_settings.repo }} - pkgrepo: varnish.repo.{{ varnish_settings.repo }}_src @@ -47,6 +50,9 @@ varnish.repo.dependencies: - pygpgme {% endif %} - yum-utils + {%- if varnish_settings.get('retry_options', {}) %} + - retry: {{ varnish_settings.retry_options | json }} + {%- endif %} - require_in: {% if salt['grains.get']('osfinger', '') in ['CentOS Linux-7', 'Amazon Linux-2'] %} - pkgrepo: varnish_epel_repo