mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
split post
This commit is contained in:
parent
132919ca42
commit
1931a31414
1 changed files with 91 additions and 0 deletions
91
roles/kolibri/tasks/post-install.yml
Normal file
91
roles/kolibri/tasks/post-install.yml
Normal file
|
@ -0,0 +1,91 @@
|
|||
- name: 'Install from template: /etc/systemd/system/kolibri.service'
|
||||
template:
|
||||
src: kolibri.service.j2
|
||||
dest: /etc/systemd/system/kolibri.service
|
||||
|
||||
- name: Stop 'kolibri' systemd service, for Kolibri provisioning (after daemon_reload)
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
name: kolibri
|
||||
state: stopped
|
||||
|
||||
|
||||
# 2019-10-01: Should no longer be nec, thanks to /etc/kolibri/daemon.conf
|
||||
# containing KOLIBRI_HOME="/library/kolibri" (above)
|
||||
# - name: Run Kolibri migrations to begin populating {{ kolibri_home }} # i.e. /library/kolibri
|
||||
# shell: export KOLIBRI_HOME="{{ kolibri_home }}" && "{{ kolibri_exec_path }}" manage migrate
|
||||
# ignore_errors: yes
|
||||
# become: yes
|
||||
# become_user: "{{ kolibri_user }}"
|
||||
# when: kolibri_provision
|
||||
|
||||
# 2020-01-05: Deprecated per https://github.com/iiab/iiab/issues/2103
|
||||
# - name: Set Kolibri default language ({{ kolibri_language }})
|
||||
# shell: export KOLIBRI_HOME="{{ kolibri_home }}" && "{{ kolibri_exec_path }}" language setdefault "{{ kolibri_language }}"
|
||||
# ignore_errors: yes
|
||||
# become: yes
|
||||
# become_user: "{{ kolibri_user }}"
|
||||
# when: kolibri_provision
|
||||
|
||||
# Run "kolibri manage help provisiondevice" to see CLI options, e.g.:
|
||||
# --facility_settings FACILITY_SETTINGS
|
||||
# JSON file containing facility settings
|
||||
# --device_settings DEVICE_SETTINGS
|
||||
# JSON file containing device settings
|
||||
- name: 'Provision Kolibri, while setting: facility name, admin acnt / password, preset type, and language'
|
||||
shell: >
|
||||
"{{ kolibri_exec_path }}" manage provisiondevice --facility "{{ kolibri_facility }}"
|
||||
--superusername "{{ kolibri_admin_user }}" --superuserpassword "{{ kolibri_admin_password }}"
|
||||
--preset "{{ kolibri_preset }}" --language_id "{{ kolibri_language }}"
|
||||
#--preset "{{ kolibri_preset }}" --language_id "{{ kolibri_language }}" --verbosity 0 --noinput
|
||||
ignore_errors: yes
|
||||
become: yes
|
||||
become_user: "{{ kolibri_user }}"
|
||||
when: kolibri_provision
|
||||
environment:
|
||||
KOLIBRI_HOME: "{{ kolibri_home }}" # 2023-03-27: Required!
|
||||
#KOLIBRI_USER: "{{ kolibri_user }}" # 2023-03-27: Not nec due to /etc/kolibri/username ?
|
||||
|
||||
|
||||
# 2023-03-25: Likely overkill (let's strongly consider removing this stanza?)
|
||||
# Certainly, setting owner (recursively) is advised when moving /library/kolibri :
|
||||
# https://kolibri.readthedocs.io/en/latest/install/ubuntu-debian.html#changing-the-owner-of-kolibri-system-service
|
||||
# 2023-03-27: Commented out on a provisional basis (Spring Cleaning)
|
||||
# - name: chown -R {{ kolibri_user }}:{{ apache_user }} {{ kolibri_home }} for good measure?
|
||||
# file:
|
||||
# path: "{{ kolibri_home }}" # /library/kolibri
|
||||
# owner: "{{ kolibri_user }}" # kolibri
|
||||
# group: "{{ apache_user }}" # www-data (on Debian/Ubuntu/Raspbian)
|
||||
# recurse: yes
|
||||
# when: kolibri_provision
|
||||
|
||||
# 2019-10-07: Moved to roles/httpd/tasks/main.yml
|
||||
# 2019-09-29: roles/kiwix/tasks/kiwix_install.yml installs 4 Apache modules
|
||||
# for similar purposes (not all nec?) Only 1 (proxy_http) is needed here.
|
||||
# - name: Enable Apache module proxy_http for http://box{{ kolibri_url }} # i.e. http://box/kolibri
|
||||
# apache2_module:
|
||||
# name: proxy_http
|
||||
|
||||
|
||||
# RECORD Kolibri AS INSTALLED
|
||||
|
||||
- name: Record (final) disk space used
|
||||
shell: df -B1 --output=used / | tail -1
|
||||
register: df2
|
||||
|
||||
- name: Add 'kolibri_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }}
|
||||
ini_file:
|
||||
path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini
|
||||
section: kolibri
|
||||
option: kolibri_disk_usage
|
||||
value: "{{ df2.stdout|int - df1.stdout|int }}"
|
||||
|
||||
- name: "Set 'kolibri_installed: True'"
|
||||
set_fact:
|
||||
kolibri_installed: True
|
||||
|
||||
- name: "Add 'kolibri_installed: True' to {{ iiab_state_file }}"
|
||||
lineinfile:
|
||||
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
|
||||
regexp: '^kolibri_installed'
|
||||
line: 'kolibri_installed: True'
|
Loading…
Add table
Add a link
Reference in a new issue