Skip to content

Commit

Permalink
Merge pull request #20 from myii/feat/add-retry-options-to-ng-for-cen…
Browse files Browse the repository at this point in the history
…tos-8

feat(ng): add `retry_options` to fix installation on `centos-8`
  • Loading branch information
myii authored Apr 1, 2020
2 parents dd0c2db + 90bd91c commit a681847
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 54 deletions.
38 changes: 22 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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=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'
Expand Down
94 changes: 56 additions & 38 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions test/salt/pillar/default.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions varnish/ng/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
6 changes: 6 additions & 0 deletions varnish/ng/repo.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a681847

Please sign in to comment.