Skip to content

fix: Provides unsupported rollback capability

John Skarbek requested to merge jts/rollback into main

What does this MR do?

This is an introductory to an opinionated method of downgrading.

  • This provides the ability to initiate a rollback with the required variable that otherwise prevents a rollback from succeeding
  • To best match upgrades, we "upgrade" in reverse
    • This is effectively a copy of the all playbook with some exceptions:
      • All imported plays are reversed - this mimics how we handle rollbacks for GitLab.com SaaS
      • We import a warning playbook to stop the user from performing this unsafe operation
  • A warning is emitted and we exit if a crucial variable is not included
  • Documentation updated to include information about the fact this exists but remains an unsupported feature of this tool
  • This commit boils down to the order of operations and setting a specific variable to enable dpkg to successfully downgrade
    • The variable gitlab_deb_force_install needs to be set
    • We need to downgrade in reverse order than we install to be closer to official support of downgrades
  • This task should still be considered dangerous as many variables come into play
  • The intended method of calling this play would be similar to the following:
    • ansible-playbook playbooks/rollback -e accept_the_danger=true
  • Opted for this to be a patch update as this new component is unsupported

This was turned down via: #890 (closed)

🥂 to hoping for a second opinion 😬

But minor work to get started in this commit.

Related issues

Initial conversation: #890 (closed)

This work helps support: gitlab-com/gl-infra/delivery#20111

Author's checklist

When ready for review, the Author applies the workflowready for review label and mention @gl-quality/get-maintainers:

  • Merge request:
    • Corresponding Issue raised and reviewed by the GET maintainers team.
    • Merge Request Title and Description are up-to-date, accurate, and descriptive
    • MR targeting the appropriate branch
    • MR has a green pipeline
    • MR has no new security alerts in the widget from the Secret Detection and IaC Scan (SAST) jobs.
  • Code:
    • Check the area changed works as expected. Consider testing it in different environment sizes (1k,3k,10k,etc.).
    • Documentation created/updated in the same MR.
    • If this MR adds an optional configuration - check that all permutations continue to work.
    • [-] For Terraform changes: set up a previous version environment, then run a terraform plan with your new changes and ensure nothing will be destroyed. If anything will be destroyed and this can't be avoided please add a comment to the current MR.
  • Create any follow-up issue(s) to support the new feature across other supported cloud providers or advanced configurations. Create 1 issue for each provider/configuration. Contact the Quality Enablement team if unsure.
Edited by John Skarbek

Merge request reports