Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/w/2.5/bugfix/fix-salt-upgrade-do…
Browse files Browse the repository at this point in the history
…wngrade' into w/2.6/bugfix/fix-salt-upgrade-downgrade
  • Loading branch information
TeddyAndrieux committed May 6, 2020
2 parents 3a69161 + ccc81c0 commit 0ac4d19
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
7 changes: 7 additions & 0 deletions salt/_modules/metalk8s_package_manager_yum.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ def list_pkg_dependents(
)
return None

# NOTE: Currently dependencies are not properly handle for downgrade
# purpose, only add a special case for `salt` as it's one known issue
# during downgrade
# https://github.com/scality/metalk8s/issues/2523
if name.startswith('salt-'):
all_pkgs['salt'] = version

dependents = _list_dependents(
name,
version,
Expand Down
4 changes: 4 additions & 0 deletions salt/metalk8s/orchestrate/deploy_node.sls
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ Reconfigure salt-minion:
- saltenv: metalk8s-{{ version }}
- sls:
- metalk8s.salt.minion.configured
# NOTE: This state may upgrade/downgrade salt-minion package and also
# restart salt-minion service, so it may take time to answer salt-master
# job query, so increase timeout for this specific state
- timeout: 200
- require:
- salt: Set grains
- salt: Refresh the mine
Expand Down
6 changes: 6 additions & 0 deletions salt/metalk8s/salt/minion/installed.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
include :
- metalk8s.repo
- .running
Install salt-minion:
{{ pkg_installed('salt-minion') }}
# NOTE: launch `salt-minion` installation/upgrade/downgrade at the
# end as this may have impact on the running salt states
- order: last
- require:
- test: Repositories configured
- require_in:
- cmd: Restart salt-minion
11 changes: 6 additions & 5 deletions salt/metalk8s/salt/minion/running.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ Restart salt-minion:
- bg: true

Wait until salt-minion restarted:
module.wait:
- test.sleep:
- length: 10
- watch:
test.configurable_test_state:
- changes: False
- result: __slot__:salt:test.sleep(10)
- comment: Wait a bit for 'salt-minion' to restart
- onchanges:
- cmd: Restart salt-minion

Ensure salt-minion running:
service.running:
- name: salt-minion
- enable: True
- require:
- module: Wait until salt-minion restarted
- test: Wait until salt-minion restarted
test.configurable_test_state:
- changes: False
- result: __slot__:salt:test.ping()
Expand Down

0 comments on commit 0ac4d19

Please sign in to comment.