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
2017-06-29 17:48:41 +00:00
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
2019-05-24 22:33:10 +00:00
when : schooltool_enabled | bool
2017-05-27 18:09:50 +00:00
- name : Enable schooltool
service : name=schooltool
state=started
enabled=yes
2019-05-24 22:33:10 +00:00
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 }}"
2020-01-12 02:41:37 +00:00
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 }}"