1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00
iiab/roles/elgg/tasks/enable.yml

53 lines
1.7 KiB
YAML
Raw Normal View History

# Apache
2019-09-01 08:11:01 +00:00
- name: Enable http://box{{ elgg_url }} via Apache # http://box/elgg
command: a2ensite elgg.conf
when: apache_install and elgg_enabled
2019-09-01 08:11:01 +00:00
- name: Disable http://box{{ elgg_url }} via Apache # http://box/elgg
command: a2dissite elgg.conf
when: apache_install and not elgg_enabled
2020-01-04 11:38:35 +00:00
- name: Restart Apache systemd service ({{ apache_service }})
2020-01-04 11:38:35 +00:00
systemd:
2019-09-01 08:11:01 +00:00
name: "{{ apache_service }}"
2020-01-04 11:38:35 +00:00
state: restarted
when: apache_enabled | bool
2020-01-04 11:38:35 +00:00
# NGINX
- name: "SHIM: Enable http://box{{ elgg_url }} via NGINX, by installing {{ nginx_config_dir }}/elgg-nginx.conf from template" # http://box/elgg
template:
src: elgg-nginx.conf.j2
dest: "{{ nginx_config_dir }}/elgg-nginx.conf"
when: nginx_install and elgg_enabled
- name: "SHIM: Disable http://box{{ elgg_url }} via NGINX, by removing {{ nginx_config_dir }}/elgg-nginx.conf" # http://box/elgg
file:
path: "{{ nginx_config_dir }}/elgg-nginx.conf"
state: absent
when: nginx_install and not elgg_enabled
- name: Restart 'nginx' systemd service
2020-01-04 11:38:35 +00:00
systemd:
name: nginx
2019-09-01 08:11:01 +00:00
state: restarted
when: nginx_enabled | bool
2019-09-01 08:11:01 +00:00
- name: Add 'elgg' variable values to {{ iiab_ini_file }}
ini_file:
path: "{{ iiab_ini_file }}"
section: elgg
option: "{{ item.option }}"
value: "{{ item.value | string }}"
2019-09-01 08:11:01 +00:00
with_items:
- option: name
value: Elgg
- option: description
value: '"Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications."'
- option: path
value: /opt/elgg
- option: elgg_enabled
value: "{{ elgg_enabled }}"