2020-02-04 20:03:59 +00:00
- name : Install Sugarizer if 'sugarizer_installed' not defined, e.g. in {{ iiab_state_file }} # /etc/iiab/iiab_state.yml
include_tasks : install.yml
when : sugarizer_installed is undefined
- block: # 2 STANZAS BELOW, CONDITIONED ON 'when : sugarizer_enabled | bool'
2020-09-22 05:04:06 +00:00
# LIKELY UNNEC: THIS SAME CODE IS IN main.yml (LINES 32-35, ALREADY RUN)
2020-02-04 20:03:59 +00:00
# sugarizer.service line 'Requires=mongodb.service' auto-starts MongoDB (but record that in var too)
- name : "Set 'mongodb_enabled: True' if sugarizer_enabled"
set_fact :
mongodb_enabled : True
- name : Enable & Restart 'sugarizer' systemd service, if sugarizer_enabled
systemd :
name : sugarizer
daemon_reload : yes # In case mongodb.service changed, etc
enabled : yes
state : restarted
when: sugarizer_enabled | bool # CONDITION FOR 2-STANZA block : ABOVE
# Stops 'sugarizer' but not 'mongodb'
2020-08-26 03:31:20 +00:00
- name : Disable & Stop 'sugarizer' systemd service, if not sugarizer_enabled
systemd :
name : sugarizer
enabled : no
state : stopped
when : not sugarizer_enabled
2020-02-04 20:03:59 +00:00
- name : Enable/Disable/Restart Apache if primary
include_tasks : apache.yml
when : not nginx_enabled
- name : Enable/Disable/Restart NGINX if primary
include_tasks : nginx.yml
when : nginx_enabled | bool
- name : Add 'sugarizer' variable values to {{ iiab_ini_file }}
ini_file :
path : "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini
section : sugarizer
option : "{{ item.option }}"
value : "{{ item.value | string }}"
with_items :
- option : name
value : Sugarizer
- option : description
value : '"The Sugar Learning Platform began with the famous One Laptop Per Child project, written in Python. Sugarizer is the new HTML/JavaScript implementation of Sugar, usable in most all browsers."'
- option : sugarizer_enabled
value : "{{ sugarizer_enabled }}"