mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
commit
3f6c897ba1
15 changed files with 135 additions and 99 deletions
|
@ -19,13 +19,13 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
with_items:
|
with_items:
|
||||||
- { src: "awstats-nginx.conf", dest: "/etc/nginx/conf.d/" }
|
- { src: "awstats-nginx.conf", dest: "{{ nginx_config_dir }}/" }
|
||||||
- { src: "cgi-bin.php", dest: "/etc/nginx/" }
|
- { src: "cgi-bin.php", dest: "/etc/nginx/" }
|
||||||
when: awstats_enabled and nginx_enabled
|
when: awstats_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: Remove /etc/nginx/conf.d/awstats-nginx.conf
|
- name: Remove {{ nginx_config_dir }}/awstats-nginx.conf
|
||||||
file:
|
file:
|
||||||
path: /etc/nginx/conf.d/awstats-nginx.conf
|
path: "{{ nginx_config_dir }}/awstats-nginx.conf"
|
||||||
state: absent
|
state: absent
|
||||||
when: not awstats_enabled
|
when: not awstats_enabled
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,6 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
with_items:
|
with_items:
|
||||||
# - { src: "awstats-nginx.conf", dest: "/etc/nginx/conf.d/" }
|
|
||||||
# - { src: "cgi-bin.php", dest: "/etc/nginx/" }
|
|
||||||
- { src: "apache-awstats.conf", dest: "/etc/{{ apache_config_dir }}/awstats.conf" }
|
- { src: "apache-awstats.conf", dest: "/etc/{{ apache_config_dir }}/awstats.conf" }
|
||||||
when: awstats_enabled and is_debuntu
|
when: awstats_enabled and is_debuntu
|
||||||
|
|
||||||
|
|
|
@ -4,17 +4,7 @@
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: restarted
|
state: restarted
|
||||||
when: calibreweb_enabled | bool
|
when: calibreweb_enabled
|
||||||
|
|
||||||
# Default: http://box/books
|
|
||||||
# SEE ALSO: https://github.com/janeczku/calibre-web/wiki/Setup-Reverse-Proxy
|
|
||||||
- name: Enable http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} with Apache
|
|
||||||
command: a2ensite calibre-web.conf
|
|
||||||
when: calibreweb_enabled | bool
|
|
||||||
|
|
||||||
#- name: Restart Apache after enabling calibre-web httpd2 site
|
|
||||||
# command: apachectl -k graceful
|
|
||||||
# when: calibreweb_enabled | bool
|
|
||||||
|
|
||||||
- name: Disable 'calibre-web' systemd service
|
- name: Disable 'calibre-web' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -24,15 +14,17 @@
|
||||||
state: stopped
|
state: stopped
|
||||||
when: not calibreweb_enabled
|
when: not calibreweb_enabled
|
||||||
|
|
||||||
|
# Default: http://box/books
|
||||||
|
# SEE ALSO: https://github.com/janeczku/calibre-web/wiki/Setup-Reverse-Proxy
|
||||||
|
- name: Enable http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} with Apache
|
||||||
|
command: a2ensite calibre-web.conf
|
||||||
|
when: calibreweb_enabled and not nginx_enabled
|
||||||
|
|
||||||
- name: Disable http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} with Apache
|
- name: Disable http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} with Apache
|
||||||
command: a2dissite calibre-web.conf
|
command: a2dissite calibre-web.conf
|
||||||
when: not calibreweb_enabled or nginx_enabled | bool
|
when: not calibreweb_enabled or nginx_enabled | bool and apache_install
|
||||||
|
|
||||||
#- name: Restart Apache after disabling calibre-web httpd2 site
|
- name: Install {{ nginx_config_dir }}/calibre-web-nginx.conf
|
||||||
# command: apachectl -k graceful
|
|
||||||
# when: not calibreweb_enabled
|
|
||||||
|
|
||||||
- name: Install /etc/nginx/conf.d/calibre-web-nginx.conf
|
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
|
@ -40,20 +32,26 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
with_items:
|
with_items:
|
||||||
- { src: 'calibre-web-nginx.conf.j2', dest: '/etc/nginx/conf.d/calibre-web-nginx.conf', mode: '0644' }
|
- { src: 'calibre-web-nginx.conf.j2', dest: '{{ nginx_config_dir }}/calibre-web-nginx.conf', mode: '0644' }
|
||||||
when: calibreweb_enabled | bool and nginx_enabled | bool
|
when: calibreweb_enabled and nginx_enabled
|
||||||
|
|
||||||
|
- name: Remove {{ nginx_config_dir }}/calibre-web-nginx.conf
|
||||||
|
file:
|
||||||
|
path: {{ nginx_config_dir }}/calibre-web-nginx.conf
|
||||||
|
state: absent
|
||||||
|
when: not calibreweb_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: Restart nginx systemd service
|
- name: Restart nginx systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: nginx
|
||||||
state: restarted
|
state: restarted
|
||||||
when: calibreweb_enabled | bool and nginx_enabled | bool
|
when: calibreweb_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: Restart Apache systemd service ({{ apache_service }})
|
- name: Restart Apache systemd service ({{ apache_service }})
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ apache_service }}" # httpd or apache2
|
name: "{{ apache_service }}" # httpd or apache2
|
||||||
state: restarted
|
state: restarted
|
||||||
when: not nginx_enabled | bool
|
when: not nginx_enabled
|
||||||
|
|
||||||
- name: Add 'calibre-web' variable values to {{ iiab_ini_file }}
|
- name: Add 'calibre-web' variable values to {{ iiab_ini_file }}
|
||||||
ini_file:
|
ini_file:
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
src: /etc/{{ apache_config_dir }}/gitea.conf
|
src: /etc/{{ apache_config_dir }}/gitea.conf
|
||||||
dest: /etc/apache2/sites-enabled/gitea.conf
|
dest: /etc/apache2/sites-enabled/gitea.conf
|
||||||
state: link
|
state: link
|
||||||
when: gitea_enabled and is_debuntu
|
when: gitea_enabled and not nginx_enabled
|
||||||
|
|
||||||
- name: Remove apache httpd conf file (OS's other than debuntu)
|
- name: Remove apache httpd conf file (OS's other than debuntu)
|
||||||
file:
|
file:
|
||||||
|
@ -36,21 +36,19 @@
|
||||||
|
|
||||||
- name: Remove nginx httpd conf file
|
- name: Remove nginx httpd conf file
|
||||||
file:
|
file:
|
||||||
path: /etc/nginx/conf.d/gitea-nginx.conf
|
path: "{{ nginx_config_dir }}/gitea-nginx.conf"
|
||||||
state: absent
|
state: absent
|
||||||
when: not gitea_enabled
|
when: not gitea_enabled
|
||||||
|
|
||||||
- name: Enable nginx httpd conf file
|
- name: Enable nginx httpd conf file
|
||||||
template:
|
template:
|
||||||
src: gitea-nginx.conf.j2
|
src: gitea-nginx.conf.j2
|
||||||
dest: /etc/nginx/conf.d/gitea-nginx.conf
|
dest: "{{ nginx_config_dir }}/gitea-nginx.conf"
|
||||||
when: gitea_enabled and nginx_enabled
|
when: gitea_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: >-
|
- name: Restart nginx
|
||||||
Restart Apache ({{ apache_service }}) to {% if gitea_enabled %}enable{%
|
|
||||||
else %}disable{% endif %} http://box/gitea
|
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ apache_service }}"
|
name: nginx
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
src: /etc/apache2/sites-available/kiwix.conf
|
src: /etc/apache2/sites-available/kiwix.conf
|
||||||
path: /etc/apache2/sites-enabled/kiwix.conf
|
path: /etc/apache2/sites-enabled/kiwix.conf
|
||||||
state: link
|
state: link
|
||||||
when: kiwix_enabled | bool and not nginx_enabled | bool
|
when: kiwix_enabled and not nginx_enabled
|
||||||
|
|
||||||
- name: Install nginx support
|
- name: Install nginx support
|
||||||
template:
|
template:
|
||||||
|
@ -14,14 +14,20 @@
|
||||||
group: root
|
group: root
|
||||||
mode: "{{ item.mode }}"
|
mode: "{{ item.mode }}"
|
||||||
with_items:
|
with_items:
|
||||||
- { src: 'kiwix-nginx.conf', dest: '/etc/nginx/conf.d/kiwix-nginx.conf', mode: '0644' }
|
- { src: 'kiwix-nginx.conf', dest: '{{ nginx_config_dir }}/kiwix-nginx.conf', mode: '0644' }
|
||||||
when: kiwix_enabled | bool and nginx_enabled | bool
|
when: kiwix_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: Remove symlink /etc/apache2/sites-enabled/kiwix.conf
|
- name: Remove symlink /etc/apache2/sites-enabled/kiwix.conf
|
||||||
file:
|
file:
|
||||||
path: /etc/apache2/sites-enabled/kiwix.conf
|
path: /etc/apache2/sites-enabled/kiwix.conf
|
||||||
state: absent
|
state: absent
|
||||||
when: not kiwix_enabled | bool or nginx_enabled | bool
|
when: not kiwix_enabled or nginx_enabled
|
||||||
|
|
||||||
|
- name: Remove {{ nginx_config_dir }}/kiwix-nginx.conf
|
||||||
|
file:
|
||||||
|
path: "{{ nginx_config_dir }}/kiwix-nginx.conf"
|
||||||
|
state: absent
|
||||||
|
when: not kiwix_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: Enable & Restart 'kiwix-serve' service
|
- name: Enable & Restart 'kiwix-serve' service
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -29,7 +35,7 @@
|
||||||
name: kiwix-serve
|
name: kiwix-serve
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: restarted
|
state: restarted
|
||||||
when: kiwix_enabled | bool
|
when: kiwix_enabled
|
||||||
|
|
||||||
- name: Disable 'kiwix-serve' service
|
- name: Disable 'kiwix-serve' service
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -59,9 +65,19 @@
|
||||||
when: kiwix_enabled and is_redhat
|
when: kiwix_enabled and is_redhat
|
||||||
|
|
||||||
- name: Restart Apache, so it picks up kiwix.conf
|
- name: Restart Apache, so it picks up kiwix.conf
|
||||||
service:
|
systemd:
|
||||||
name: "{{ apache_service }}"
|
name: "{{ apache_service }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
daemon-reload: yes
|
||||||
|
when: not nginx_enabled
|
||||||
|
|
||||||
|
- name: Restart nginx service
|
||||||
|
systemd:
|
||||||
|
name: nginx
|
||||||
|
state: restarted
|
||||||
|
daemon-reload: yes
|
||||||
|
when: nginx_enabled
|
||||||
|
|
||||||
|
|
||||||
# 5. FINALIZE
|
# 5. FINALIZE
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,7 @@
|
||||||
name: kolibri
|
name: kolibri
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
when: kolibri_enabled | bool
|
when: kolibri_enabled
|
||||||
|
|
||||||
- name: Enable http://box{{ kolibri_url }} with Apache (a2ensite) if kolibri_enabled # i.e. http://box/kolibri
|
|
||||||
command: a2ensite kolibri.conf
|
|
||||||
when: kolibri_enabled | bool and not nginx_enabled | bool
|
|
||||||
|
|
||||||
- name: Disable & Stop 'kolibri' systemd service if not kolibri_enabled
|
- name: Disable & Stop 'kolibri' systemd service if not kolibri_enabled
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -16,11 +12,15 @@
|
||||||
state: stopped
|
state: stopped
|
||||||
when: not kolibri_enabled
|
when: not kolibri_enabled
|
||||||
|
|
||||||
|
- name: Enable http://box{{ kolibri_url }} with Apache (a2ensite) if kolibri_enabled # i.e. http://box/kolibri
|
||||||
|
command: a2ensite kolibri.conf
|
||||||
|
when: kolibri_enabled and not nginx_enabled
|
||||||
|
|
||||||
- name: Disable http://box{{ kolibri_url }} with Apache (a2dissite) if not kolibri_enabled
|
- name: Disable http://box{{ kolibri_url }} with Apache (a2dissite) if not kolibri_enabled
|
||||||
command: a2dissite kolibri.conf
|
command: a2dissite kolibri.conf
|
||||||
when: not kolibri_enabled or nginx_enabled | bool
|
when: not kolibri_enabled or nginx_enabled
|
||||||
|
|
||||||
- name: Supply /etc/nginx/conf.d/kolibri-nginx.conf when nginx_enabled
|
- name: Supply {{ nginx_config_dir }}/kolibri-nginx.conf when nginx_enabled
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
|
@ -28,24 +28,26 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
with_items:
|
with_items:
|
||||||
- { src: 'kolibri-nginx.conf.j2', dest: '/etc/nginx/conf.d/kolibri-nginx.conf', mode: '0644' }
|
- { src: 'kolibri-nginx.conf.j2', dest: '{{ nginx_config_dir }}/kolibri-nginx.conf', mode: '0644' }
|
||||||
when: kolibri_enabled | bool and nginx_enabled | bool
|
when: kolibri_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: Disable http://box{{ kolibri_url }} with Apache (a2dissite) if not kolibri_enabled
|
- name: Remove {{ nginx_config_dir }}/kolibri-nginx.conf when not nginx_enabled
|
||||||
command: a2dissite kolibri.conf
|
file:
|
||||||
when: not kolibri_enabled or nginx_enabled | bool
|
path: "{{ nginx_config_dir }}/kolibri-nginx.conf"
|
||||||
|
state: absent
|
||||||
|
when: not kolibri_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: Restart Apache service ({{ apache_service }}) # e.g. apache2
|
- name: Restart Apache service ({{ apache_service }}) # e.g. apache2
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ apache_service }}"
|
name: "{{ apache_service }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
when: not nginx_enabled | bool
|
when: not nginx_enabled
|
||||||
|
|
||||||
- name: Restart nginx service
|
- name: Restart nginx service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: nginx
|
||||||
state: restarted
|
state: restarted
|
||||||
when: nginx_enabled | bool
|
when: nginx_enabled
|
||||||
|
|
||||||
- name: Add 'kolibri' variable values to {{ iiab_ini_file }} # /etc/iiab/iiab.ini
|
- name: Add 'kolibri' variable values to {{ iiab_ini_file }} # /etc/iiab/iiab.ini
|
||||||
ini_file:
|
ini_file:
|
||||||
|
|
|
@ -3,12 +3,24 @@
|
||||||
src: /etc/apache2/sites-available/mediawiki.conf
|
src: /etc/apache2/sites-available/mediawiki.conf
|
||||||
dest: /etc/apache2/sites-enabled/mediawiki.conf
|
dest: /etc/apache2/sites-enabled/mediawiki.conf
|
||||||
state: link
|
state: link
|
||||||
when: mediawiki_enabled and is_debuntu
|
when: mediawiki_enabled and not nginx_enabled
|
||||||
|
|
||||||
- name: Remove mediawiki.conf if not mediawiki_enabled (debuntu)
|
- name: Remove mediawiki.conf if not mediawiki_enabled (debuntu)
|
||||||
file:
|
file:
|
||||||
path: /etc/apache2/sites-enabled/mediawiki.conf
|
path: /etc/apache2/sites-enabled/mediawiki.conf
|
||||||
state: absent
|
state: absent
|
||||||
|
when: not mediawiki_enabled or nginx_enabled
|
||||||
|
|
||||||
|
- name: Install {{ nginx_config_dir }}/mediawiki-nginx.conf from template, for http://box{{ mediawiki_url }}
|
||||||
|
template:
|
||||||
|
src: mediawiki-nginx.conf.j2
|
||||||
|
dest: "{{ nginx_config_dir }}/mediawiki-nginx.conf"
|
||||||
|
when: mediawiki_enabled and nginx_enabled
|
||||||
|
|
||||||
|
- name: Remove mediawiki-nginx.conf if not mediawiki_enabled (debuntu)
|
||||||
|
file:
|
||||||
|
path: "{{ nginx_config_dir }}/mediawiki-nginx.conf"
|
||||||
|
state: absent
|
||||||
when: not mediawiki_enabled and is_debuntu
|
when: not mediawiki_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Restart Apache service ({{ apache_service }}) to enable/disable http://box{{ mediawiki_url }}
|
- name: Restart Apache service ({{ apache_service }}) to enable/disable http://box{{ mediawiki_url }}
|
||||||
|
@ -16,24 +28,14 @@
|
||||||
name: "{{ apache_service }}"
|
name: "{{ apache_service }}"
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
state: restarted
|
state: restarted
|
||||||
|
when: mediawiki_enabled and not nginx_enabled
|
||||||
- name: Install {{ nginx_config_dir }}/mediawiki-nginx.conf from template, for http://box{{ mediawiki_url }}
|
|
||||||
template:
|
|
||||||
src: mediawiki-nginx.conf.j2
|
|
||||||
dest: "{{ nginx_config_dir }}/mediawiki-nginx.conf"
|
|
||||||
when: mediawiki_enabled
|
|
||||||
|
|
||||||
- name: Remove mediawiki-nginx.conf if not mediawiki_enabled (debuntu)
|
|
||||||
file:
|
|
||||||
path: "{{ nginx_config_dir }}/mediawiki-nginx.conf"
|
|
||||||
state: absent
|
|
||||||
when: not mediawiki_enabled and is_debuntu
|
|
||||||
|
|
||||||
- name: Restart nginx service to enable/disable http://box{{ mediawiki_url }}
|
- name: Restart nginx service to enable/disable http://box{{ mediawiki_url }}
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: nginx
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
state: restarted
|
state: restarted
|
||||||
|
when: nginx_enabled
|
||||||
|
|
||||||
- name: Add 'mediawiki' variable values to {{ iiab_ini_file }}
|
- name: Add 'mediawiki' variable values to {{ iiab_ini_file }}
|
||||||
ini_file:
|
ini_file:
|
||||||
|
|
|
@ -4,21 +4,24 @@
|
||||||
3. Current state (10/16/19)
|
3. Current state (10/16/19)
|
||||||
1. Principal functions migrated to nginx.
|
1. Principal functions migrated to nginx.
|
||||||
* Admin Console
|
* Admin Console
|
||||||
* Awstats
|
|
||||||
* kalite -- goes directly to port 8009
|
* kalite -- goes directly to port 8009
|
||||||
* usb-lib
|
|
||||||
* maps
|
* maps
|
||||||
|
* usb-lib
|
||||||
2. Dual support
|
2. Dual support
|
||||||
* kiwix -- goes directly to port 3000
|
* Awstats
|
||||||
* calibre-web
|
* calibre-web
|
||||||
|
* gitea
|
||||||
|
* kiwix -- goes directly to port 3000
|
||||||
* kolibri
|
* kolibri
|
||||||
* sugarizer
|
|
||||||
3. Still proxied to Apache
|
|
||||||
* mediawiki
|
* mediawiki
|
||||||
|
* sugarizer
|
||||||
|
* wordpress
|
||||||
|
3. Still proxied to Apache
|
||||||
|
* dokuwiki
|
||||||
* elgg
|
* elgg
|
||||||
|
* lokole
|
||||||
|
* moodle
|
||||||
* nodered
|
* nodered
|
||||||
* nextcloud
|
* nextcloud
|
||||||
* wordpress
|
|
||||||
* moodle
|
|
||||||
4. Not dealt with yet
|
4. Not dealt with yet
|
||||||
* archive.org
|
* archive.org
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
- { src: "server.conf",dest: "/etc/nginx/" }
|
- { src: "server.conf",dest: "/etc/nginx/" }
|
||||||
- { src: "nginx.conf",dest: "/etc/nginx/" }
|
- { src: "nginx.conf",dest: "/etc/nginx/" }
|
||||||
- { src: "ports.conf" , dest: "/etc/{{ apache_service }}/" }
|
- { src: "ports.conf" , dest: "/etc/{{ apache_service }}/" }
|
||||||
- { src: "iiab.conf.j2",dest: "/etc/nginx/conf.d/iiab.conf" }
|
- { src: "iiab.conf.j2",dest: "{{ nginx_config_dir }}/iiab.conf" }
|
||||||
when: nginx_enabled
|
when: nginx_enabled
|
||||||
|
|
||||||
- name: Clean stale config files
|
- name: Clean stale config files
|
||||||
|
@ -14,8 +14,8 @@
|
||||||
state: absent
|
state: absent
|
||||||
path: '{{ item.path }}'
|
path: '{{ item.path }}'
|
||||||
with_items:
|
with_items:
|
||||||
- { path: "/etc/nginx/conf.d/usb-lib.conf" }
|
- { path: "{{ nginx_config_dir }}/usb-lib.conf" }
|
||||||
- { path: "/etc/nginx/conf.d/modules.conf" }
|
- { path: "{{ nginx_config_dir }}/modules.conf" }
|
||||||
|
|
||||||
- name: Insure that apache2 is not running -- we may need port swap
|
- name: Insure that apache2 is not running -- we may need port swap
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
location {{ dokuwiki_url }} {
|
location {{ dokuwiki_url }} {
|
||||||
proxy_pass http://127.0.0.1:{{ apache_port }}/{{ dokuwiki_url }};
|
proxy_pass http://127.0.0.1:{{ apache_port }}{{ dokuwiki_url }};
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ server {
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
# let individual services drop location blocks in conf.d
|
# let individual services drop location blocks in conf.d
|
||||||
include /etc/nginx/conf.d/*;
|
include {{ nginx_config_dir }}/*;
|
||||||
|
|
||||||
location ~ .*\.php$ {
|
location ~ .*\.php$ {
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|
|
@ -69,17 +69,17 @@
|
||||||
src: map_functions.js
|
src: map_functions.js
|
||||||
dest: '{{ vector_map_path }}/maplist/assets'
|
dest: '{{ vector_map_path }}/maplist/assets'
|
||||||
|
|
||||||
- name: Install /etc/nginx/conf.d/osm-vector-maps.conf from template
|
- name: Install {{ nginx_config_dir }}/osm-vector-maps.conf from template
|
||||||
template:
|
template:
|
||||||
src: osm-vector-maps-nginx.conf
|
src: osm-vector-maps-nginx.conf
|
||||||
dest: "/etc/nginx/conf.d/osm-vector-maps-nginx.conf"
|
dest: "{{ nginx_config_dir }}/osm-vector-maps-nginx.conf"
|
||||||
when: osm_vector_maps_enabled | bool
|
when: osm_vector_maps_enabled
|
||||||
|
|
||||||
- name: Remove config /etc/nginx/conf,d/osm-vector-maps.conf (debuntu)
|
- name: Remove {{ nginx_config_dir }}/osm-vector-maps.conf (debuntu)
|
||||||
file:
|
file:
|
||||||
path: /etc/nginx/conf.d/osm-vector-maps-nginx.conf
|
path: "{{ nginx_config_dir }}/osm-vector-maps-nginx.conf"
|
||||||
state: absent
|
state: absent
|
||||||
when: not osm_vector_maps_enabled | bool
|
when: not osm_vector_maps_enabled
|
||||||
|
|
||||||
#- name: Does the {{ vector_map_path }}/index.html redirect already exist?
|
#- name: Does the {{ vector_map_path }}/index.html redirect already exist?
|
||||||
# stat:
|
# stat:
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
dest: "{{ vector_map_path }}/index.html"
|
dest: "{{ vector_map_path }}/index.html"
|
||||||
#when: not osm_redirect.stat.exists
|
#when: not osm_redirect.stat.exists
|
||||||
|
|
||||||
- name: Reload Apache service ({{ apache_service }}) # e.g. apache2
|
- name: Reload nginx
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ apache_service }}"
|
name: nginx
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
src: /etc/apache2/sites-available/sugarizer.conf
|
src: /etc/apache2/sites-available/sugarizer.conf
|
||||||
path: /etc/apache2/sites-enabled/sugarizer.conf
|
path: /etc/apache2/sites-enabled/sugarizer.conf
|
||||||
state: link
|
state: link
|
||||||
when: sugarizer_enabled | bool and not nginx_enabled | bool
|
when: sugarizer_enabled and not nginx_enabled
|
||||||
|
|
||||||
- name: Remove symlink /etc/apache2/sites-enabled/sugarizer.conf (if not sugarizer_enabled)
|
- name: Remove symlink /etc/apache2/sites-enabled/sugarizer.conf (if not sugarizer_enabled)
|
||||||
file:
|
file:
|
||||||
path: /etc/apache2/sites-enabled/sugarizer.conf
|
path: /etc/apache2/sites-enabled/sugarizer.conf
|
||||||
state: absent
|
state: absent
|
||||||
when: not sugarizer_enabled | bool or nginx_enabled | bool
|
when: not sugarizer_enabled or nginx_enabled
|
||||||
|
|
||||||
- name: "Install sugarizer-nginx.conf (nginx)"
|
- name: "Install sugarizer-nginx.conf (nginx)"
|
||||||
template:
|
template:
|
||||||
|
@ -19,8 +19,14 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
with_items:
|
with_items:
|
||||||
- { src: 'sugarizer-nginx.conf', dest: '/etc/nginx/conf.d/sugarizer-nginx.conf' , mode: '0644' }
|
- { src: 'sugarizer-nginx.conf', dest: '{{ nginx_config_dir }}/sugarizer-nginx.conf', mode: '0644' }
|
||||||
when: sugarizer_enabled | bool and nginx_enabled | bool
|
when: sugarizer_enabled and nginx_enabled
|
||||||
|
|
||||||
|
- name: Remove {{ nginx_config_dir }}/sugarizer-nginx.conf (if not sugarizer_enabled)
|
||||||
|
file:
|
||||||
|
path: "{{ nginx_config_dir }}/sugarizer-nginx.conf"
|
||||||
|
state: absent
|
||||||
|
when: not sugarizer_enabled and nginx_enabled
|
||||||
|
|
||||||
# 6. RESTART/STOP SYSTEMD SERVICE
|
# 6. RESTART/STOP SYSTEMD SERVICE
|
||||||
|
|
||||||
|
@ -31,7 +37,7 @@
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: restarted
|
state: restarted
|
||||||
when: sugarizer_enabled | bool
|
when: sugarizer_enabled
|
||||||
|
|
||||||
- name: Disable & Stop 'sugarizer' systemd service (if not sugarizer_enabled)
|
- name: Disable & Stop 'sugarizer' systemd service (if not sugarizer_enabled)
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -62,7 +68,7 @@
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ apache_service }}" # httpd or apache2
|
name: "{{ apache_service }}" # httpd or apache2
|
||||||
state: restarted
|
state: restarted
|
||||||
when: sugarizer_enabled | bool and not nginx_enabled | bool
|
when: sugarizer_enabled and not nginx_enabled
|
||||||
|
|
||||||
- name: Restart nginx when enabled
|
- name: Restart nginx when enabled
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
src: /etc/apache2/sites-available/wordpress.conf
|
src: /etc/apache2/sites-available/wordpress.conf
|
||||||
path: /etc/apache2/sites-enabled/wordpress.conf
|
path: /etc/apache2/sites-enabled/wordpress.conf
|
||||||
state: link
|
state: link
|
||||||
when: wordpress_enabled and is_debuntu
|
when: wordpress_enabled and not nginx_enabled
|
||||||
|
|
||||||
- name: Remove /etc/apache2/sites-enabled/wordpress.conf if not wordpress_enabled (debuntu)
|
- name: Remove /etc/apache2/sites-enabled/wordpress.conf if not wordpress_enabled (debuntu)
|
||||||
file:
|
file:
|
||||||
|
@ -11,10 +11,29 @@
|
||||||
state: absent
|
state: absent
|
||||||
when: not wordpress_enabled and is_debuntu
|
when: not wordpress_enabled and is_debuntu
|
||||||
|
|
||||||
|
- name: Install {{ nginx_config_dir }}/wordpress-nginx.conf from template, for http://box{{ wp_url }}
|
||||||
|
template:
|
||||||
|
src: wordpress-nginx.conf.j2
|
||||||
|
dest: "{{ nginx_config_dir }}/wordpress-nginx.conf"
|
||||||
|
when: wordpress_enabled and nginx_enabled
|
||||||
|
|
||||||
|
- name: Remove {{ nginx_config_dir }}/wordpress-nginx.conf if not wordpress_enabled (debuntu)
|
||||||
|
file:
|
||||||
|
path: "{{ nginx_config_dir }}/wordpress-nginx.conf"
|
||||||
|
state: absent
|
||||||
|
when: not wordpress_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: Restart Apache service ({{ apache_service }}) to enable/disable http://box{{ wp_url }}
|
- name: Restart Apache service ({{ apache_service }}) to enable/disable http://box{{ wp_url }}
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ apache_service }}"
|
name: "{{ apache_service }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
when: not nginx_enabled
|
||||||
|
|
||||||
|
- name: Restart nginx service to enable/disable http://box{{ wp_url }}
|
||||||
|
systemd:
|
||||||
|
name: nginx
|
||||||
|
state: restarted
|
||||||
|
when: nginx_enabled
|
||||||
|
|
||||||
- name: Add 'wordpress' variable values to {{ iiab_ini_file }}
|
- name: Add 'wordpress' variable values to {{ iiab_ini_file }}
|
||||||
ini_file:
|
ini_file:
|
||||||
|
|
|
@ -101,12 +101,6 @@
|
||||||
dest: "/etc/{{ apache_config_dir }}/wordpress.conf"
|
dest: "/etc/{{ apache_config_dir }}/wordpress.conf"
|
||||||
when: apache_enabled
|
when: apache_enabled
|
||||||
|
|
||||||
- name: Install {{ nginx_config_dir }}/wordpress-nginx.conf from template, for http://box{{ wp_url }}
|
|
||||||
template:
|
|
||||||
src: wordpress-nginx.conf.j2
|
|
||||||
dest: "{{ nginx_config_dir }}/wordpress-nginx.conf"
|
|
||||||
when: nginx_enabled
|
|
||||||
|
|
||||||
- name: Add 'wordpress_installed' variable values to {{ iiab_state_file }}
|
- name: Add 'wordpress_installed' variable values to {{ iiab_state_file }}
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: "{{ iiab_state_file }}"
|
dest: "{{ iiab_state_file }}"
|
||||||
|
|
Loading…
Reference in a new issue