Skip to content

Commit

Permalink
Introduce skip_upgrade_check option
Browse files Browse the repository at this point in the history
A funny situation arose when we introduced the option to fail early when Scylla is already installed and upgrade_version == False:

It may happen that the role failed during its runtime, therefore leaving the target systems in an inconsistent state. When this happens, if the failure happened AFTER the Scylla package was installed, then the user would be left in an chicken-and-egg situation:
They can not re-execute the playbook installing the specified version, as the upgrade will abort since we are upgrading to the same release. Similarly, they can not install Scylla again, as it will complain that the package is already installed.

We circumvent that situation by introducing the `skip_upgrade_check` option, which is a failsafe mechanism to allow a role failure to proceed on installation even when `upgrade_version` is False. Needless to say, this option is False by default.
  • Loading branch information
fee-mendes committed Jul 4, 2022
1 parent 3d94734 commit 5d855a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ansible-scylla-node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
# UPGRADE
# ==============================

# Skips role upgrade check. Useful if the role failed in the middle of an installation.
# Values:
# [default] false: Fail when Scylla is installed and the upgrade_version == False
# true: When upgrade_version == False, re-run the install process
skip_upgrade_check: false

# Upgrades Scylla version if a previous installation is detected
# Values:
# [default] false: don't check for upgrades
Expand Down
3 changes: 2 additions & 1 deletion ansible-scylla-node/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
msg: >
Detected an existing Scylla installation.
Should you want to upgrade, set `upgrade_version' to True.
If you are recovering from a failed role run, set `skip_upgrade_check' to True.
when: >
not upgrade_version and
not upgrade_version and not skip_upgrade_check and
( 'scylla-server' in ansible_facts.packages or
'scylla-enterprise-server' in ansible_facts.packages )
Expand Down

0 comments on commit 5d855a1

Please sign in to comment.