Skip to content

[BB-3331] Add ability to configure appserver.yml version

Boros Gábor requested to merge 0x29a/make_ocim_compatible_with_ansible2.8 into master

Created by: 0x29a

What this PR is about?

It adds the ability to configure default playbook options per instance.

Consider this snippet: https://github.com/open-craft/opencraft/blob/2adf770f010f7a0c3a7e89a6d2da73052a3d28cb/opencraft/settings.py#L589-L599

Currently, to use different version of appserver.yml playbook, you have to change some of these settings, then restart Ocim. Then, after deployment, you have to change settings back because they're used by every new instance.

To be able to set this per instance, I added four new fields to Open edX instance model: https://github.com/open-craft/opencraft/blob/b24a63891bbae1304ad851210a73bc045cae4c4a/instance/models/openedx_appserver.py#L127-L152

So, now we can set them from admin panel: Screenshot from 2020-12-20 19-22-19

"Settings" tab of instance now has new settings listed:

image

Why do we need to set different versions of playbooks for instances?

Because Ansible version is hardcoded in ansible-playbooks repo. And unfortunately, version 2.5.1 doesn't work with Ubuntu 20.04, which Koa depends on. So, we have no ability to deploy Koa instances without reloading Ocim now.

With this change, we'll be able to use a different version of ansible-playbooks repo for Koa instances.

Another benefit is that we don't need to test all our playbooks to upgrade clients to Koa.

Does this affect existing instances somehow?

No, they'll be using the same appserver.yml playbook as before.

Other information

JIRA tickets:

  • BB-3331.
  • It will unblock BB-3266 (periodic builds of open-release/koa.master).
  • It can make BB-3309 less critical.

Sandbox URL With this fix, I successfully deployed and activated a new app server for https://juniper-koa.stage.opencraft.hosting/ instance.

Author notes and concerns: Each commit in this PR has detailed description.

Testing instructions:

  1. Open https://stage.manage.opencraft.com/admin/instance/openedxinstance/675/change/
  2. Change Ansible appserver version to master.
  3. Try to create a new app server for this instance. Deployment should fail, since master version uses Ansible 2.5.1, which isn't compatible with Ubuntu 20.04.

Merge request reports