-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: install additional plugins from Git repos
- Loading branch information
1 parent
8ceb54d
commit 0efe349
Showing
10 changed files
with
262 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
# This file is part of Ansible role geoffreyvanwyk.moodle. | ||
# | ||
# Ansible role geoffreyvanwyk.moodle is free software: you can redistribute it | ||
# and/or modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Ansible role geoffreyvanwyk.moodle is distributed in 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 | ||
# Ansible role geoffreyvanwyk.moodle. If not, see | ||
# <https://www.gnu.org/licenses/>. | ||
|
||
## | ||
# Contains the call to the role when testing with Molecule. | ||
# | ||
# @copyright 2023 Geoffrey Bernardo van Wyk (https://geoffreyvanwyk.dev) | ||
## | ||
|
||
- name: Converge | ||
hosts: all | ||
|
||
vars_files: | ||
- vars/main.yml | ||
|
||
tasks: | ||
- name: Update APT package cache | ||
# Sometimes the package list on the server does not contain all the | ||
# available packages. A fresh list has to be downloaded from the Ubuntu | ||
# package repositories. | ||
become: true | ||
ansible.builtin.apt: | ||
update_cache: true | ||
cache_valid_time: "{{ 60 * 60 * 24 }}" # seconds => 24 hours | ||
|
||
- name: "Include geoffreyvanwyk.moodle" | ||
ansible.builtin.include_role: | ||
name: "geoffreyvanwyk.moodle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
# This file is part of Ansible role geoffreyvanwyk.moodle. | ||
# | ||
# Ansible role geoffreyvanwyk.moodle is free software: you can redistribute it | ||
# and/or modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Ansible role geoffreyvanwyk.moodle is distributed in 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 | ||
# Ansible role geoffreyvanwyk.moodle. If not, see | ||
# <https://www.gnu.org/licenses/>. | ||
|
||
## | ||
# The central configuration entrypoint for Molecule. | ||
# | ||
# @copyright 2023 Geoffrey Bernardo van Wyk (https://geoffreyvanwyk.dev) | ||
# @link http://tinyurl.com/molecule-scenario-layout | ||
## | ||
|
||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: ansible_role_moodle_molecule_${MOLECULE_DISTRO:-ubuntu2204} | ||
image: "geoffreyvanwyk/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest" | ||
pre_build_image: true | ||
published_ports: | ||
- "0.0.0.0:80:80" | ||
provisioner: | ||
name: ansible | ||
inventory: | ||
host_vars: | ||
ansible_role_moodle_molecule_${MOLECULE_DISTRO:-ubuntu2204}: | ||
ansible_user: ubuntu | ||
moodle_deploy_version: ${MOLECULE_MOODLE_VERSION:-MOODLE_403_STABLE} | ||
verifier: | ||
name: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
# This file is part of Ansible role geoffreyvanwyk.moodle. | ||
# | ||
# Ansible role geoffreyvanwyk.moodle is free software: you can redistribute it | ||
# and/or modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Ansible role geoffreyvanwyk.moodle is distributed in 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 | ||
# Ansible role geoffreyvanwyk.moodle. If not, see | ||
# <https://www.gnu.org/licenses/>. | ||
|
||
## | ||
# Override variables for this Molecule scenario. | ||
# | ||
# @copyright 2023 Geoffrey Bernardo van Wyk (https://geoffreyvanwyk.dev) | ||
## | ||
|
||
moodle_plugins_git: | ||
- name: theme_learningsandboxonline | ||
repository: >- | ||
https://github.com/geoffreyvanwyk/moodle-theme_learningsandboxonline | ||
version: "{{ moodle_deploy_version }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
# This file is part of Ansible role geoffreyvanwyk.moodle. | ||
# | ||
# Ansible role geoffreyvanwyk.moodle is free software: you can redistribute it | ||
# and/or modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Ansible role geoffreyvanwyk.moodle is distributed in 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 | ||
# Ansible role geoffreyvanwyk.moodle. If not, see | ||
# <https://www.gnu.org/licenses/>. | ||
|
||
## | ||
# Contains specific tests against the state of the container after the role has | ||
# finished executing. | ||
# | ||
# @copyright 2023 Geoffrey Bernardo van Wyk (https://geoffreyvanwyk.dev) | ||
## | ||
|
||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
|
||
vars_files: | ||
- ../../defaults/main.yml | ||
- vars/main.yml | ||
|
||
tasks: | ||
- name: Obtain list of additional plugins | ||
args: | ||
executable: /bin/bash | ||
ansible.builtin.shell: | ||
chdir: "{{ moodle_deploy_destination }}" | ||
cmd: >- | ||
set -o pipefail | ||
&& | ||
php admin/cli/uninstall_plugins.php --show-contrib | ||
| | ||
cut -f1 | ||
register: moodle_additional_plugins_installed | ||
changed_when: false | ||
|
||
- name: Assert that plugins are installed | ||
loop: "{{ moodle_plugins_git }}" | ||
ansible.builtin.assert: | ||
that: item.name in moodle_additional_plugins_installed.stdout_lines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
# This file is part of Ansible role geoffreyvanwyk.moodle. | ||
# | ||
# Ansible role geoffreyvanwyk.moodle is free software: you can redistribute it | ||
# and/or modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Ansible role geoffreyvanwyk.moodle is distributed in 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 | ||
# Ansible role geoffreyvanwyk.moodle. If not, see | ||
# <https://www.gnu.org/licenses/>. | ||
|
||
## | ||
# Clone source code of plugins from remote Git repository hosts like GitHub. | ||
# | ||
# @copyright 2023 Geoffrey Bernardo van Wyk (https://geoffreyvanwyk.dev) | ||
## | ||
|
||
- name: Deploy source code of plugins | ||
loop: "{{ moodle_plugins_git }}" | ||
ansible.builtin.git: | ||
repo: "{{ item.repository }}" | ||
version: "{{ item.version }}" | ||
dest: "{{ | ||
moodle_deploy_destination + '/' + | ||
lookup( | ||
'geoffreyvanwyk.moodle.plugin_directory', | ||
frankenstyle_name=item.name | ||
) | ||
}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters