1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/moodle-1.9/moodle/tasks/main.yml
georgejhunt f319afa432 Test (#20)
* change apache_data to apache_user in all

* no libapach2 in centos. just php. no php-magick in centos

* remove redundant vars entries

* do not create apache user

* missed one pound sign

* soft code all references to apache_user

* centos requires older setuptools

* revert ansible_lsb.id in xsce.yml

* try getting recent pip

* move pip download to 2prep so that kalite success is not dependent on iiab coming first

* still need to replace setuptools in kalite

* add curl -- needed in debian

* massivly substitue iiab for xsce, and rename files

* completed runansible

* centos fixes,install  pip

* appliance means no iptables rules

* change to earlier version of setuptools for centos

* delete file duplicate, hopefully unnecessary. generate the offline docs

* wiki docs errors

* create the admin group -- deleted earlier

* use the --yes option with pip uninstall

* base of repo moved from schoolserver to iiab, unleashkids.org->iiab.io

* network detection broken due to tupo
2017-06-09 16:25:56 -07:00

93 lines
2.3 KiB
YAML

---
- name: Install moodle required packages
package: name={{ item }}
state=present
with_items:
- moodle-xs
- python-psycopg2
tags:
- download
- name: Remove stock moodle conf
file: path='/etc/{{ apache_config_dir }}/moodle.conf'
state=absent
- name: Configure moodle
template: backup=yes
src={{ item.src }}
dest={{ item.dest }}
owner=root
group=root
mode={{ item.mode }}
with_items:
- src: '020-iiab-moodle.conf.j2'
dest: '/etc/{{ apache_config_dir }}/020-iiab-moodle.conf'
mode: '0655'
- src: 'moodle-xs.service.j2'
dest: '/etc/systemd/system/moodle-xs.service'
mode: '0655'
- src: 'moodle-xs-init'
dest: '/usr/libexec/moodle-xs-init'
mode: '0755'
- name: Stop postgresql
service: name=postgresql
state=stopped
- name: Start postgresql-xs
service: name=postgresql-xs
state=started
- name: Create db user
postgresql_user: name=apache
password=apache
role_attr_flags=NOSUPERUSER,NOCREATEROLE,NOCREATEDB
state=present
become: yes
become_user: postgres
- name: Create database
postgresql_db: name=moodle-xs
encoding=utf8
owner=apache
template=template0
state=present
sudo: yes
sudo_user: postgres
- name: Execute moodle startup script
command: /usr/libexec/moodle-xs-init start
- name: Restart postgresql-xs
service: name=postgresql-xs
state=restarted
- name: Restart httpd
service: name={{ apache_service }}
state=restarted
- name: Enable moodle service
service: name=moodle-xs
enabled=yes
state=started
- name: fetch the administrative password for moodle
shell: cat /etc/moodle/adminpw
register: moodlepw
- name: add moodle to service list
ini_file: dest='{{ service_filelist }}'
section=moodle
option='{{ item.option }}'
value='{{ item.value }}'
with_items:
- option: name
value: Moodle
- option: description
value: '"Access the Moodle learning management system."'
- option: path
value: /moodle
- option: enabled
value: "{{ moodle_enabled }}"
- option: adminpw
value: "{{ moodlepw.stdout }}"