mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
supply base config files and cleanup
This commit is contained in:
parent
021ca725a5
commit
0879bcd457
3 changed files with 26 additions and 18 deletions
|
@ -16,3 +16,11 @@
|
||||||
file:
|
file:
|
||||||
path: /etc/nginx/sites-enabled/default
|
path: /etc/nginx/sites-enabled/default
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
|
- name: Put the config file in place
|
||||||
|
template:
|
||||||
|
src: '{{ item.src}}'
|
||||||
|
dest: '{{ item.dest }}'
|
||||||
|
with_items:
|
||||||
|
- { src: "server.conf",dest: "/etc/nginx/" }
|
||||||
|
- { src: "nginx.conf",dest: "/etc/nginx/" }
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
# the above should be enough once uwsgi is started
|
# the above should be enough once uwsgi is started
|
||||||
# - { src: "uwsgi.unit",dest: "/etc/systemd/system/uwsgi.socket" }
|
# - { src: "uwsgi.unit",dest: "/etc/systemd/system/uwsgi.socket" }
|
||||||
- { src: 'ports.conf' , dest: '/etc/{{ apache_service }}/' , mode: '0644' }
|
- { src: 'ports.conf' , dest: '/etc/{{ apache_service }}/' , mode: '0644' }
|
||||||
when: nginx_enabled | bool
|
when: nginx_enabled
|
||||||
|
|
||||||
- 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:
|
||||||
|
@ -24,20 +24,20 @@
|
||||||
# Comment one or the other to revert from nginx back to apache2, if required
|
# Comment one or the other to revert from nginx back to apache2, if required
|
||||||
# src: admin-console-apache.conf
|
# src: admin-console-apache.conf
|
||||||
dest: /etc/nginx/conf.d/admin-console.conf
|
dest: /etc/nginx/conf.d/admin-console.conf
|
||||||
when: admin_console_enabled | bool and nginx_enabled | bool
|
when: admin_console_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: Enable the uwsgi systemd service
|
- name: Enable the uwsgi systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: uwsgi
|
name: uwsgi
|
||||||
state: started
|
state: started
|
||||||
enabled: True
|
enabled: True
|
||||||
when: admin_console_enabled | bool and nginx_enabled | bool
|
when: admin_console_enabled and nginx_enabled
|
||||||
|
|
||||||
# the below slides in nginx's proxypass config files for apache on localhost
|
# the below slides in nginx's proxypass config files for apache on localhost
|
||||||
# via the ports.conf file installed above
|
# via the ports.conf file installed above
|
||||||
- name: Install proxpass to apache running on localhost port {{ apache_port }}
|
- name: Install proxpass to apache running on localhost port {{ apache_port }}
|
||||||
include_tasks: uses_apache.yml
|
include_tasks: uses_apache.yml
|
||||||
when: nginx_enabled | bool
|
when: nginx_enabled
|
||||||
|
|
||||||
# the below task contains the same logic contained in the playbooks to enable
|
# the below task contains the same logic contained in the playbooks to enable
|
||||||
# 'runrole nginx' to do the right thing but with the 'src' path set to role's
|
# 'runrole nginx' to do the right thing but with the 'src' path set to role's
|
||||||
|
@ -45,25 +45,25 @@
|
||||||
|
|
||||||
- name: Install proxpass to other services 'dual mode' roles
|
- name: Install proxpass to other services 'dual mode' roles
|
||||||
include_tasks: only_nginx.yml
|
include_tasks: only_nginx.yml
|
||||||
when: nginx_enabled | bool
|
when: nginx_enabled
|
||||||
|
|
||||||
- name: Stop and disable nginx when not nginx_enabled
|
- name: Stop and disable nginx when not nginx_enabled
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: nginx
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: false
|
enabled: false
|
||||||
when: not nginx_enabled | bool
|
when: not nginx_enabled
|
||||||
|
|
||||||
- name: Disable apache port {{ apache_port }} localhost only
|
- name: Disable apache port {{ apache_port }} localhost only
|
||||||
template:
|
template:
|
||||||
dest: /etc/{{ apache_service }}/ports.conf
|
dest: /etc/{{ apache_service }}/ports.conf
|
||||||
src: stock-apache-ports.conf
|
src: stock-apache-ports.conf
|
||||||
when: not nginx_enabled | bool
|
when: not nginx_enabled
|
||||||
|
|
||||||
# should have the logic to handle both modes in the playbook
|
# should have the logic to handle both modes in the playbook
|
||||||
- name: Rerun 'dual mode' roles by calling role's main.yml file when ngix is disabled
|
- name: Enable Apache (a2ensite) for 'dual mode' for the role when NGINX is diabled
|
||||||
include_tasks: disable.yml
|
include_tasks: disable.yml
|
||||||
when: not nginx_enabled | bool
|
when: not nginx_enabled
|
||||||
|
|
||||||
- name: Since we stopped apache2, start it again
|
- name: Since we stopped apache2, start it again
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: true
|
enabled: true
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
when: apache_enabled | bool
|
when: apache_enabled
|
||||||
|
|
||||||
- name: Restart nginx to pick up the config files installed
|
- name: Restart nginx to pick up the config files installed
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -79,4 +79,4 @@
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: true
|
enabled: true
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
when: nginx_enabled | bool
|
when: nginx_enabled
|
||||||
|
|
|
@ -5,29 +5,29 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
when: moodle_enabled | bool
|
when: moodle_enabled
|
||||||
|
|
||||||
- name: Install /etc/nginx/conf.d/elgg-nginx.conf from template
|
- name: Install /etc/nginx/conf.d/elgg-nginx.conf from template
|
||||||
template:
|
template:
|
||||||
src: elgg-nginx.conf
|
src: elgg-nginx.conf
|
||||||
dest: "/etc/nginx/conf.d/elgg-nginx.conf"
|
dest: "/etc/nginx/conf.d/elgg-nginx.conf"
|
||||||
when: elgg_enabled | bool
|
when: elgg_enabled
|
||||||
|
|
||||||
- name: Install /etc/nginx/lokole-nginx.conf from template
|
- name: Install /etc/nginx/lokole-nginx.conf from template
|
||||||
template:
|
template:
|
||||||
src: lokole-nginx.conf.j2
|
src: lokole-nginx.conf.j2
|
||||||
dest: "/etc/nginx/conf.d/lokole-nginx.conf"
|
dest: "/etc/nginx/conf.d/lokole-nginx.conf"
|
||||||
when: lokole_enabled | bool
|
when: lokole_enabled
|
||||||
|
|
||||||
- name: Install MediaWiki's nginx conf.d file from template
|
- name: Install MediaWiki's nginx conf.d file from template
|
||||||
template:
|
template:
|
||||||
src: mediawiki-nginx.conf.j2
|
src: mediawiki-nginx.conf.j2
|
||||||
dest: /etc/nginx/conf.d/mediawiki-nginx.conf
|
dest: /etc/nginx/conf.d/mediawiki-nginx.conf
|
||||||
when: mediawiki_enabled | bool
|
when: mediawiki_enabled
|
||||||
|
|
||||||
- name: Install WordPress's nginx conf.d file from template
|
- name: Install WordPress's nginx conf.d file from template
|
||||||
template: src=nextcloud-nginx.conf dest=/etc/nginx/conf.d/nextcloud-nginx.conf
|
template: src=nextcloud-nginx.conf dest=/etc/nginx/conf.d/nextcloud-nginx.conf
|
||||||
when: nextcloud_enabled | bool
|
when: nextcloud_enabled
|
||||||
|
|
||||||
- name: Install NodeRed's nginx conf.d file from template
|
- name: Install NodeRed's nginx conf.d file from template
|
||||||
template:
|
template:
|
||||||
|
@ -36,13 +36,13 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0666
|
mode: 0666
|
||||||
when: nodered_enabled | bool
|
when: nodered_enabled
|
||||||
|
|
||||||
- name: Install WordPress's nginx conf.d file from template
|
- name: Install WordPress's nginx conf.d file from template
|
||||||
template:
|
template:
|
||||||
src: wordpress-nginx.conf
|
src: wordpress-nginx.conf
|
||||||
dest: /etc/nginx/conf.d/
|
dest: /etc/nginx/conf.d/
|
||||||
when: wordpress_enabled | bool
|
when: wordpress_enabled
|
||||||
|
|
||||||
#- name: Install proxpass to apache running on localhost
|
#- name: Install proxpass to apache running on localhost
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue