1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/dokuwiki/tasks/enable.yml

52 lines
1.7 KiB
YAML

# Apache
- name: Enable http://box{{ dokuwiki_url }} via Apache # http://box/dokuwiki
command: a2ensite dokuwiki.conf
when: apache_install and dokuwiki_enabled
- name: Disable http://box{{ dokuwiki_url }} via Apache # http://box/dokuwiki
command: a2dissite dokuwiki.conf
when: apache_install and not dokuwiki_enabled
- name: Restart Apache systemd service ({{ apache_service }})
systemd:
name: "{{ apache_service }}"
state: restarted
when: apache_enabled | bool
# NGINX
- name: "SHIM: Enable http://box{{ dokuwiki_url }} via NGINX, by installing {{ nginx_config_dir }}/dokuwiki-nginx.conf from template" # http://box/dokuwiki
template:
src: dokuwiki-nginx.conf.j2
dest: "{{ nginx_config_dir }}/dokuwiki-nginx.conf"
when: nginx_install and dokuwiki_enabled
- name: "SHIM: Disable http://box{{ dokuwiki_url }} via NGINX, by removing {{ nginx_config_dir }}/dokuwiki-nginx.conf" # http://box/dokuwiki
file:
path: "{{ nginx_config_dir }}/dokuwiki-nginx.conf"
state: absent
when: nginx_install and not dokuwiki_enabled
- name: Restart 'nginx' systemd service
systemd:
name: nginx
state: restarted
when: nginx_enabled | bool
- name: Add 'dokuwiki' variable values to {{ iiab_ini_file }}
ini_file:
path: "{{ iiab_ini_file }}"
section: dokuwiki
option: "{{ item.option }}"
value: "{{ item.value | string }}"
with_items:
- option: name
value: DokuWiki
- option: description
value: '"DokuWiki is a simple to use and highly versatile Open Source wiki software that does not require a database."'
- option: installed
value: "{{ dokuwiki_install }}"
- option: enabled
value: "{{ dokuwiki_enabled }}"