How are you deploying moodle?

Re: How are you deploying moodle?

by Brendan Anderson -
Number of replies: 0

I have a proof of concept Ansible role for automating moodle installation:

https://github.com/hcpss-banderson/ansible-role-moodle

The idea is that you pass it variables for core version, plugin versions and configuration details. And it assembles all the code, runs the installation or imports the database and even applies patches.

It works great for provisioning a development environment. But as you say it's not a dependency management tool. It's not generic. I am trying to modify it for deployment, where all I need is for it to assemble the core, the plugins apply the patches and maybe generate the config file. I think I can get it working by introducing some new parameters to specify whether to run the installation/import or not.

Downsides:

  1. I have to introduce new parameters to control the flow of the playbook.
  2. Ansible does not have much logic. So instead of only having to specify in the params that I want "block_rss_plus" version "2.2" and having Ansible consume the plugin web service to find the proper download, I have to specify the download url myself. Even the logic of where to put a plugin is too much. "local_myplugin" goes in "local" so that makes sense. but "block_rss_plus" goes in "blocks". And "format_grid" goes in "course/format"? Simple enough for a programming language, but Ansible is a configuration language. So, I have to hard code the installation location in the params.

It would be better if Ansible kicked of a "composer install" or "moosh make" (similar to drush make).