Skip to content

Autoscaling Moodle stack with Redis cache and Postgres database on Azure Cloud.

License

Notifications You must be signed in to change notification settings

CSPS-EFPC-IT/moodle-cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moodle Cluster

Deployed the required resources in Azure Cloud to operate a scalable Moodle cluster.

Prerequisites

  1. A resource group exist.
  2. You have the authorizations required to create resources in the resource group to use.
  3. A TLS Certificate for the Application Gateway must exist in a Key Vault.
  4. A User Managed Identity must exist.
  5. Proper access privileges to the Application Gateway TLS Certificate must be granted to the User Managed Identity.

Usage

Step 1 - Create the infrastructure (Part 1/2)

  1. Create a new file named armTemplates/azureDeploy-part1.parameters.json based on the armTemplates/azureDeploy-part1.parameters.example.json file.
  2. Edit the new azureDeploy-part1.parameters.json file to your need.
  3. Adapt and run the following commands:
    deploymentName="MyDeploymentPart1"
    resourceGroupName="[Your resource Group name]"
    templateFile="armTemplate/azureDeploy-part1.json"
    parameterFile="armTemplates/azureDeploy-part1.parameters.json"
    az deployment group create --name $deploymentName --resource-group $resourceGroupName --template-file $templateFile --parameter @$parameterFile --verbose

Step 2 - Create a virtual machine image from the latest version of Moodle 3.8

  1. Adapt and run the following commands:
    scripts/create_vm_image.sh -applicationFqdn "[Use the application FQDN registered in DNS or the Application Gateway Public IP FQDN as output from part 1]" -applicationNetworkSecurityGroupName "[The application network security name]" -applicationSubnetName "[Use the corresponding value returned as output from part 1]" -databaseAdminPassword="[Use the corresponding value used as input for part 1]" -databaseAdminUsername "[Use the corresponding value used as input for part 1]" -databaseApplicationDatabaseName "[Use the corresponding value output from part 1]" -databaseMoodlePassword "[A secret password]" -databaseMoodleUsername "[A username]" -databaseFqdn "[Use the corresponding value returned as output from part 1]" -databaseName "[Use the corresponding value returned as output from part 1]" -fileRepositoryUri "[Use the corresponding value used as input from part 1]" -moodleAdminEmail "[An email address]" -moodleAdminPassword "[A secret password]" -moodleAdminUsername "[A username]" -moodleShareName "[Use the corresponding value returned as output from part 1]" -moodleStorageAccountFilePrimaryEndPoint "[Use the corresponding value returned as output from part 1]" -moodleStorageAccountKey "[Use the corresponding value returned as output from part 1]" -moodleStorageAccountName "[Use the corresponding value returned as output from part 1]" -moodleUpgradeKey "[A secret Moodle upgrade key] -redisHostName "[Use the corresponding value returned as output from part 1]" -redisName "[Use the corresponding value returned as output from part 1]" redisPrimaryKey "[Use the corresponding value returned as output from part 1]" -resourceGroupName "The same resource group name used in part 1" -virtualMachineTags "[key1=value1 key2=value2 ... keyN=valueN]" -virtualNetworkName "[Use the corresponding value returned as output from part 1]" -vmImageName "[something]-$(date +'%Y%m%dT%H%M%S%Z')-VM-Image" -vmName "[something]-$(date +'%Y%m%dT%H%M%S%Z')-VM" -webServerAdminPassword "[A password]" -webServerAdminUsername "[A username]"

Step 3 - Create the infrastructure (Part 2/2)

  1. Create a new file named armTemplates/azureDeploy-part2.parameters.json based on the armTemplates/azureDeploy-part2.parameters.example.json file.
  2. Edit the new azureDeploy-part2.parameters.json file to your need.
  3. Adapt and Run the following commands:
    deploymentName="MyDeploymentPart2"
    resourceGroupName="[Your resource Group name]"
    templateFile="armTemplate/azureDeploy-part2.json"
    parameterFile="armTemplates/azureDeploy-part2.parameters.json"
    az deployment group create --name MyDeployment-part2 --resource-group $myResourceGroup --template-file armTemplate/azuredeploy-part2.json --parameter armTemplate/azuredeploy-part2.parameters.json --verbose

About

Autoscaling Moodle stack with Redis cache and Postgres database on Azure Cloud.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published