geoffreyvanwyk.moodle_uninstall

Ansible Role to Uninstall Moodle

build

This role uninstalls a Moodle instance that was set up using Ansible Role for Moodle by:

  • Removing the Apache web server configuration,
  • Deleting the scheduled task (cron job),
  • Dropping the database,
  • Removing the moodledata folder, and
  • Deleting the Moodle source code from the web root directory.

Requirements

Mention any prerequisites that are not covered by Ansible or this role. For example, if the role uses the EC2 module, indicate that the boto package is needed.

The role removes only Moodle instances installed from a subdirectory.

It is tested only on long-term support versions of Ubuntu that still receive standard support.

This role only works with PostgreSQL databases.

Role Variables

Describe the variables that can be set for this role, including those in defaults/main.yml and vars/main.yml. Mention any variables that are read from other roles or the global scope.

Only moodle_cfg_dbtype has a default value. You must provide a value for each of the variables listed here.

Web

moodle_web_domain: ""
moodle_web_path: ""

These two variables are needed to determine moodle_instance, which uniquely identifies your Moodle setup. This identity is used in naming files, directories, and other objects related to that instance.


Delete Source Code

moodle_deploy_destination: ""

The path to the Moodle source code.


Drop Database

moodle_cfg_dbtype: pgsql
moodle_cfg_dbname: ""

The postgres user is used to drop the database.


Remove Apache configuration

moodle_web_apache_conf: ""  # Derived from `moodle_instance`.

The name of the Apache configuration file.


Installation & Server-Side configuration

moodle_cfg_dataroot: ""  # Derived from `moodle_instance`.

The path to the moodledata directory.

Dependencies

List other roles hosted on Galaxy that this role depends on, including details on any parameters that need to be set.

The roles and collections needed for this role are listed in requirements.yml.

Example Playbook

It's helpful to include an example of using your role (with variables passed as parameters):

- hosts: servers
  roles:
    - role: geoffreyvanwyk.moodle_uninstall
      moodle_web_domain: www.example.com
      moodle_web_path: moodle

License

Copyright © 2023 Geoffrey Bernardo van Wyk https://geoffreyvanwyk.dev

This file is part of the Ansible role geoffreyvanwyk.moodle_uninstall.

Ansible role geoffreyvanwyk.moodle_uninstall is free software: you can share it and/or change it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 or any later version.

This role is provided with the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this role. If not, see https://www.gnu.org/licenses/.

Author Information

An optional section for the authors to include contact details or a website (HTML is not allowed).

Geoffrey Bernardo van Wyk created this role in 2023.

Informazioni sul progetto

Uninstalls a Moodle instance

Installa
ansible-galaxy install geoffreyvanwyk.moodle_uninstall
Licenza
gpl-3.0
Download
363
Proprietario
I first learned computer programming in a module at Stellenbosch University in the '90s. The programming language was Fortran.