moodle

Ansible Role: Moodle

Installs and configures Moodle.

Requirements

Make sure the minimum requirements for Moodle are meet before using this role.

Role Variables

Available variables are listed below, see defaults/main.yml for the default values.

moodle_root_path: /var/www/moodle

The path where Moodle will be installed.

moodle_dataroot_path: /var/www/moodledata

The path for the 'moodledata' data folder. This will be created if it doesn't exist.

moodle_version: '3.3'

By default, the latest version of Moodle will be installed. You can specify which version to install by setting the moodle_version variable.

moodle_root_user: root
moodle_root_group: root
moodle_root_permissions: '0755'

By default, the owner and group of the 'moodle' root folder will be root. This can be changed by setting the moodle_root_user and moodle_root_group variables. The permissions mode for this folder is 0755 by default, use the moodle_root_permissions variable to change this.

moodle_dataroot_user: www-data
moodle_dataroot_group: www-data
moodle_dataroot_permissions: '0777'

By default, the owner and group of the 'moodledata' folder will be www-data. This can be changed by setting the moodle_dataroot_user and moodle_dataroot_group variables. The permissions mode for this folder is 0777 by default, use the moodle_dataroot_permissions variable to change this.

moodle_fullname: My Moodle website
moodle_shortname: mymoodle

Set the moodle_fullname variable to the fullname of the site. The moodle_shortname variable should contain the shortname of the site.

moodle_wwwroot: https://example.com

The moodle_wwwroot variable should contain the web address for the Moodle site.

moodle_database_type: pgsql

By default, Moodle uses MySQL for it's database. To use a different type of database, set the moodle_database_type variable. Supported database types are pgsql, mariadb, mysqli, mssql, sqlsrv and oci.

moodle_database_name: example_database
moodle_database_user: example_user
moodle_database_password: secret

Configure the database that Moodle will use.

moodle_database_host: '192.168.2.18'
moodle_database_port: '33060'
moodle_database_prefix: app_

The default database host used by Moodle is localhost, use the moodle_database_host variable to set this to something different. The default port used by the database is 3306 for MySQL, use the moodle_database_port variable to set a different port. The mdl_ prefix is added to the name of all the database tables created by Moodle. To change this prefix set the moodle_database_prefix variable.

moodle_admin_username: admin
moodle_admin_password: P@ssw0rd
moodle_admin_email: [email protected]

Configure the default admin account.

moodle_enable_debug: true

By default, debug mode is off for Moodle. To enable debug mode use the set the moodle_enable_debug variable to true.

Dependencies

None.

Example Playbook

- hosts: server
  become: yes

  tasks:
  - import_role:
      name: damianlewis.moodle
About

Installs and configures Moodle

Install
ansible-galaxy install damianlewis/ansible-role-moodle
GitHub repository
License
Unknown
Downloads
306