1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/schooltool/tasks/main.yml

71 lines
2.3 KiB
YAML
Raw Normal View History

2017-05-27 18:09:50 +00:00
# the defaults on this image are user:manager, password:schooltool
- name: Get the schooltool container if it is missing
docker: image=ghunt/schooltool:latest
ports=7080:7080
state=present
pull=missing
when: schooltool_install and docker_install and internet_available
2017-05-27 18:09:50 +00:00
- name: Configure schooltool to run in docker container under systemd
template: backup=yes
src={{ item.src }}
dest={{ item.dest }}
owner=root
group=root
mode={{ item.mode }}
with_items:
- dest: '/etc/systemd/system/schooltool.service'
src: 'schooltool.service'
mode: '0644'
- dest: '/etc/{{ apache_config_dir }}/schooltool.conf'
src: 'schooltool.conf'
mode: '0644'
# create a schooltool user who can have limited capability
- name: Make a user for schooltool
user: name=schooltool
shell=/sbin/nologin
createhome=no
# create the permanent storage directory, and give world write access
# -- will eventually change the docker container to give itself write access and demote itself
- name: create Permanent Storage for persistent schooltool data
file: path=/var/lib/schooltool
state=directory
owner=schooltool
mode=0777
#Experience teaches that enabling schooltool is more likely to succeed after docker restart
- name: Restart docker
service: name=docker
state=restarted
enabled=yes
when: schooltool_enabled | bool
2017-05-27 18:09:50 +00:00
- name: Enable schooltool
service: name=schooltool
state=started
enabled=yes
when: schooltool_enabled | bool
2017-05-27 18:09:50 +00:00
- name: Disable schooltool
service: name=schooltool
state=stopped
enabled=no
when: not schooltool_enabled
2018-10-31 04:51:28 +00:00
- name: Add 'schooltool' variable values to {{ iiab_ini_file }}
ini_file:
path: "{{ iiab_ini_file }}"
section: schooltool
option: "{{ item.option }}"
value: "{{ item.value | string }}"
2017-05-27 18:09:50 +00:00
with_items:
- option: name
value: Schooltool
- option: description
value: '"SchoolTool is an open source, web based student information system designed for schools in the developing world, with strong support for translation, localization and automated deployment and updates."'
- option: enabled
value: "{{ schooltool_enabled }}"