1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Merge pull request #768 from holta/moodle-3.5

Moodle 3.1 -> 3.5 LTS TESTING (on Moodle's master branch for now)
This commit is contained in:
A Holt 2018-05-02 08:04:15 -04:00 committed by GitHub
commit b01b88464a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 25 deletions

View file

@ -1,9 +1,9 @@
moodle_version: 31
moodle_repo_url: "https://github.com/moodle/moodle.git"
moodle_version: 35
#moodle_repo_url: "https://github.com/moodle/moodle.git"
moodle_repo_url: "git://git.moodle.org/moodle.git"
moodle_base: "{{ iiab_base }}/moodle"
moodle_user: moodle
moodle_install: True
moodle_enabled: False
#moodle_user: moodle
#moodle_install: True
#moodle_enabled: False
moodle_data: '{{ content_base }}/moodle'
moodle_database_name: moodle

View file

@ -1,5 +1,4 @@
---
- name: Install Moodle required packages (OS's other than debunt)
- name: Install Moodle required packages (OS's other than debuntu)
package:
name: "{{ item }}"
state: present
@ -16,10 +15,10 @@
- python-psycopg2
- php{{ php_version }}-pgsql
- php{{ php_version }}-curl
# - php{{ php_version }}-zip
#- php{{ php_version }}-zip
- php{{ php_version }}-gd
# - php{{ php_version }}-mbstring
# mbstring is now included in php-cli
#- php{{ php_version }}-mbstring
# mbstring is now included in php-cli
- php{{ php_version }}-cli
when: is_debuntu
@ -44,8 +43,9 @@
dest: "{{ moodle_base }}"
depth: 1
force: yes
version: "MOODLE_{{ moodle_version }}_STABLE"
# ignore_errors: yes
#version: "MOODLE_{{ moodle_version }}_STABLE"
version: master # TEMPORARY DURING MAY 2018 TESTING
#ignore_errors: yes
when: internet_available and moodle.stat.exists is defined and not moodle.stat.exists
- name: Prepare the downloaded directory so Apache can install config file
@ -70,7 +70,7 @@
mode: 0770
state: directory
- name: Remove stock Moodle conf
- name: Remove stock Moodle config file
file:
path: "/etc/{{ apache_config_dir }}/moodle.conf"
state: absent
@ -106,7 +106,7 @@
postgresql_user:
name: Admin
password: changeme
encrypted: yes # Required by PostgresSQL 10.3+ e.g. on Ubuntu 18.04, see https://github.com/iiab/iiab/issues/759
encrypted: yes # Required by PostgreSQL 10+ e.g. Ubuntu 18.04's PostgreSQL 10.3+, see https://github.com/iiab/iiab/issues/759
role_attr_flags: NOSUPERUSER,NOCREATEROLE,NOCREATEDB
state: present
become: yes
@ -114,7 +114,7 @@
- name: Create database
postgresql_db:
name: moodle
name: "{{ moodle_database_name }}"
encoding: utf8
owner: Admin
template: template1
@ -140,7 +140,7 @@
name: "{{ apache_service }}"
state: restarted
- name: See if the config.php file exists
- name: See if config.php exists
stat:
path: "{{ moodle_base }}/config.php"
register: config
@ -150,7 +150,7 @@
when: config.stat.exists is defined and not config.stat.exists
- name: Give Apache permission to read config file
# command: chown -R {{ apache_user }} {{ moodle_base }}
#command: chown -R {{ apache_user }} {{ moodle_base }}
file:
path: "{{ moodle_base }}/config.php"
mode: 0644

View file

@ -1,8 +1,22 @@
#!/bin/bash -x
sudo -u {{ apache_user }} /usr/bin/php {{ moodle_base }}/admin/cli/install.php \
--wwwroot=http://{{ iiab_hostname }}.{{ iiab_domain }}/moodle --dataroot={{ moodle_data }} \
--dbtype=pgsql --dbname={{ moodle_database_name }} --dbuser=Admin --dbpass=changeme \
--fullname=Your_School --shortname=School \
--adminuser=admin --adminpass=changeme \
--non-interactive --agree-license
chown {{ apache_user }}:{{ apache_user }} {{ moodle_base }}/config.php
# May 2018: lowercase "--adminuser=admin" is still required for some odd
# reason, otherwise one cannot login to http://box.lan/moodle (with
# Admin/changeme). At the same time --dbuser=Admin still begins with
# a capital letter, in keeping with Internet-in-a-Box's other server apps?
sudo -u {{ apache_user }} \
/usr/bin/php {{ moodle_base }}/admin/cli/install.php \
--wwwroot=http://{{ iiab_hostname }}.{{ iiab_domain }}/moodle \
--dataroot={{ moodle_data }} \
--dbtype=pgsql \
--dbname={{ moodle_database_name }} \
--dbuser=Admin --dbpass=changeme \
--fullname=Your_School \
--shortname=School \
--adminuser=admin --adminpass=changeme \
--non-interactive \
--agree-license \
--allow-unstable # TEMPORARY DURING MAY 2018 TESTING
chown {{ apache_user }}:{{ apache_user }} {{ moodle_base }}/config.php