Skip to content

Commit

Permalink
feat(ng): add retry_options to fix installation on centos-8
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Apr 1, 2020
1 parent 3ebb354 commit 90bd91c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 90bd91c

Please sign in to comment.