Skip to content

Commit

Permalink
refactor(retry_options): provide options from defaults/pillar
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Mar 30, 2021
1 parent e31a56e commit bbd7286
Show file tree
Hide file tree
Showing 55 changed files with 272 additions and 15 deletions.
7 changes: 7 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,13 @@ salt:
- 'deploy':
- /srv/salt/reactors/deploy.sls

# https://docs.saltstack.com/en/latest/ref/states/requisites.html#retrying-states
retry_options:
attempts: 2
until: true
interval: 10
splay: 10

salt_cloud_certs:
aws:
pem: |
Expand Down
7 changes: 7 additions & 0 deletions salt/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ salt:
profiles: salt://salt/files/cloud.profiles.d
maps: salt://salt/files/cloud.maps.d

# https://docs.saltstack.com/en/latest/ref/states/requisites.html#retrying-states
retry_options:
attempts: 2
until: true
interval: 10
splay: 10

salt_formulas:
list: {} # via pillar data
checkout_orig_branch: false
Expand Down
6 changes: 1 addition & 5 deletions salt/master.sls
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ salt-master-macos:
- name: /Library/LaunchDaemons/com.saltstack.salt.master.plist
- source: https://raw.githubusercontent.com/saltstack/salt/master/pkg/osx/scripts/com.saltstack.salt.master.plist
- source_hash: {{ salt_settings.salt_master_macos_plist_hash }}
- retry:
attempts: 2
until: True
interval: 10
splay: 10
- retry: {{ salt_settings.retry_options | json }}
- require_in:
- service: salt-master
{%- endif %}
Expand Down
12 changes: 2 additions & 10 deletions salt/minion.sls
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ download-salt-minion:
- test -n "{{ salt_settings.version }}" && '/opt/salt/bin/salt-minion --version=.*{{ salt_settings.version }}.*'
- require_in:
- macpackage: salt-minion
- retry:
attempts: 2
until: True
interval: 10
splay: 10
- retry: {{ salt_settings.retry_options | json }}
{%- elif "workaround https://github.com/saltstack/salt/issues/49348" %}
cmd.run:
- name: /usr/local/bin/brew install {{ salt_settings.salt_minion }}
Expand All @@ -45,11 +41,7 @@ salt-minion-macos:
- name: /Library/LaunchDaemons/com.saltstack.salt.minion.plist
- source: https://raw.githubusercontent.com/saltstack/salt/master/pkg/osx/scripts/com.saltstack.salt.master.plist
- source_hash: {{ salt_settings.salt_minion_macos_plist_hash }}
- retry:
attempts: 2
until: True
interval: 10
splay: 10
- retry: {{ salt_settings.retry_options | json }}
- require_in:
- service: salt-minion
- watch_in:
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py2/files/_mapdata/ubuntu-16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: python-git
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py2/files/_mapdata/ubuntu-18.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: python-git
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py3/files/_mapdata/amazonlinux-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: GitPython
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py3/files/_mapdata/centos-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: GitPython
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py3/files/_mapdata/centos-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: GitPython
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py3/files/_mapdata/debian-10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ values:
python_git: python-git
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py3/files/_mapdata/debian-9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ values:
python_git: python-git
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py3/files/_mapdata/gentoo-2-sysd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ values:
python_git: python-git
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: app-admin/salt
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py3/files/_mapdata/gentoo-2-sysv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ values:
python_git: python-git
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: app-admin/salt
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py3/files/_mapdata/opensuse-15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: python-git
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py3/files/_mapdata/oraclelinux-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: GitPython
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py3/files/_mapdata/oraclelinux-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: GitPython
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py3/files/_mapdata/ubuntu-16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: python-git
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3000-py3/files/_mapdata/ubuntu-18.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: python-git
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ values:
python_git: python-git
release: '3000'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: kitchen
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3001-py3/files/_mapdata/amazonlinux-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: GitPython
release: '3001'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3001-py3/files/_mapdata/centos-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: GitPython
release: '3001'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3001-py3/files/_mapdata/centos-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: GitPython
release: '3001'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3001-py3/files/_mapdata/debian-10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ values:
python_git: python-git
release: '3001'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3001-py3/files/_mapdata/debian-9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ values:
python_git: python-git
release: '3001'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3001-py3/files/_mapdata/fedora-32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: GitPython
release: '3001'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3001-py3/files/_mapdata/fedora-33.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: GitPython
release: '3001'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3001-py3/files/_mapdata/gentoo-2-sysd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ values:
python_git: python-git
release: '3001'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: app-admin/salt
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3001-py3/files/_mapdata/gentoo-2-sysv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ values:
python_git: python-git
release: '3001'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: app-admin/salt
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3001-py3/files/_mapdata/opensuse-15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: python-git
release: '3001'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: python-git
release: '3001'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down
5 changes: 5 additions & 0 deletions test/integration/v3001-py3/files/_mapdata/oraclelinux-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ values:
python_git: GitPython
release: '3001'
restart_via_at: false
retry_options:
attempts: 2
interval: 10
splay: 10
until: true
rootgroup: root
rootuser: root
salt_api: salt-api
Expand Down

0 comments on commit bbd7286

Please sign in to comment.