Skip to content

fix: map mongo_version to correct mongo playbook in containerized san… - #361

Merged
srathod-apphelix merged 1 commit into
masterfrom
srathod/GSRE-4246-sandbox-mongo-playbook-mapping
Jul 27, 2026
Merged

fix: map mongo_version to correct mongo playbook in containerized san…#361
srathod-apphelix merged 1 commit into
masterfrom
srathod/GSRE-4246-sandbox-mongo-playbook-mapping

Conversation

@srathod-apphelix

Copy link
Copy Markdown
Member

Summary

Fixes containerized sandbox builds failing with ERROR! the playbook: 5.0.yml could not be found when edxapp_container_enabled=true and mongo_version=5.0.

Jira - GSRE-4246

Purpose

The CreateSandbox Jenkins job sets mongo_version to version strings like 5.0, 6.0, and 7.0. The containerized path in ansible-provision.sh was using that value directly as the playbook name (5.0.yml), while the actual playbooks are mongo_5_0.yml, mongo_6_0.yml, and mongo_7_0.yml. This change maps mongo_version to the correct playbook basename in the same block that sets MONGO_*_ENABLED flags.

Changes

  • Set mongo_playbook to mongo_5_0, mongo_6_0, or mongo_7_0 based on the selected mongo_version in ansible-provision.sh.
  • Update the containerized provisioning loop to use $mongo_playbook instead of $mongo_version when invoking ansible playbooks.

Copilot AI review requested due to automatic review settings July 27, 2026 07:16
@srathod-apphelix
srathod-apphelix merged commit 394f3b2 into master Jul 27, 2026
2 of 4 checks passed
@srathod-apphelix
srathod-apphelix deleted the srathod/GSRE-4246-sandbox-mongo-playbook-mapping branch July 27, 2026 07:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes containerized sandbox provisioning failures by mapping mongo_version values like 5.0/6.0/7.0 to the correct Ansible playbook basenames (mongo_5_0/mongo_6_0/mongo_7_0) so the containerized provisioning path no longer tries to run nonexistent playbooks like 5.0.yml.

Changes:

  • Introduces mongo_playbook mapping based on mongo_version alongside the existing MONGO_*_ENABLED flag selection.
  • Updates the containerized provisioning loop to invoke $mongo_playbook.yml rather than $mongo_version.yml.
Comments suppressed due to low confidence (1)

util/jenkins/ansible-provision.sh:741

  • The containerized provisioning loop now depends on mongo_playbook, but if mongo_version is unset/unsupported, $mongo_playbook expands empty and Mongo setup will be skipped (or an exported mongo_playbook could be used unintentionally). Add an explicit guard so failures are fast and diagnosable.
      for playbook in redis $mongo_playbook; do
          run_ansible $playbook.yml -i "${deploy_host}," $extra_var_arg --user ubuntu
      done

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -521,20 +521,23 @@ EOF_AUTH
fi

if [[ $mongo_version == "5.0" ]]; then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants