2018-07-16 18:11:07 +00:00
- name : Create Linux user {{ kolibri_user }} and add it to groups {{ apache_user }}, disk
2018-07-15 17:36:05 +00:00
user :
name : "{{ kolibri_user }}"
groups :
- "{{ apache_user }}"
- disk
state : present
shell : /bin/false
system : yes
create_home : no
2018-07-16 16:00:08 +00:00
- name : Create /library/kolibri to store data and configuration files
2018-07-15 17:36:05 +00:00
file :
path : "{{ item }}"
owner : "{{ kolibri_user }}"
group : "{{ apache_user }}"
mode : 0755
state : directory
with_items :
- "{{ kolibri_home }}"
- name : Install kolibri using pip on all OS's
pip :
name : kolibri
state : latest
when : internet_available
- name : Create kolibri systemd service file
template :
src : "{{ item.src }}"
dest : "{{ item.dest }}"
mode : "{{ item.mode }}"
owner : root
group : root
with_items :
- { src: 'kolibri.service.j2' , dest: '/etc/systemd/system/kolibri.service', mode : '0644' }
2018-07-16 16:00:08 +00:00
- name : Set kolibri default language
2018-07-15 17:36:05 +00:00
shell : export KOLIBRI_HOME="{{ kolibri_home }}" && "{{ kolibri_exec_path }}" language setdefault "{{ kolibri_language }}"
ignore_errors : yes
when : kolibri_provision
2018-07-16 16:00:08 +00:00
- name : Create kolibri default facility name, admin account and language
2018-07-15 17:36:05 +00:00
shell : >
export KOLIBRI_HOME="{{ kolibri_home }}" &&
"{{ kolibri_exec_path }}" manage provisiondevice --facility "{{ kolibri_facility }}"
--superusername "{{ kolibri_admin_user }}" --superuserpassword "{{ kolibri_admin_password }}"
--preset "{{ kolibri_preset }}" --language_id "{{ kolibri_language }}" --verbosity 0 --noinput
ignore_errors : yes
when : kolibri_provision
2018-07-16 16:00:08 +00:00
- name : Change /library/kolibri directory permissions
2018-07-15 17:36:05 +00:00
file :
path : "{{ kolibri_home }}"
owner : "{{ kolibri_user }}"
group : "{{ apache_user }}"
recurse : yes
2018-07-16 16:00:08 +00:00
- name : Enable kolibri service
2018-07-15 17:36:05 +00:00
service :
name : "{{ item.name }}"
enabled : yes
state : restarted
with_items :
- { name : kolibri }
when : kolibri_enabled
2018-07-16 16:00:08 +00:00
- name : Disable kolibri service
2018-07-15 17:36:05 +00:00
service :
name : "{{ item.name }}"
enabled : no
state : stopped
with_items :
- { name : kolibri }
when : not kolibri_enabled
- name : Add 'kolibri' to list of services at /etc/iiab/iiab.ini
ini_file :
dest : "{{ service_filelist }}"
section : kolibri
option : "{{ item.option }}"
value : "{{ item.value }}"
with_items :
- option : name
value : kolibri
- option : description
value : '"Kolibri is an open-source educational platform specially designed to provide offline access to a wide range of quality, openly licensed educational contents in low-resource contexts like rural schools, refugee camps, orphanages, and also in non-formal school programs."'
- option : kolibri_url
value : "{{ kolibri_url }}"
- option : kolibri_path
value : "{{ kolibri_path }}"
- option : kolibri_port
value : "{{ kolibri_http_port }}"
- option : enabled
value : "{{ kolibri_enabled }}"