mirror of
https://github.com/iiab/iiab.git
synced 2025-02-14 20:22:08 +00:00
supply apache ports file
This commit is contained in:
parent
90c0a3046a
commit
fcda2129c4
2 changed files with 40 additions and 8 deletions
|
@ -55,21 +55,37 @@
|
|||
enabled: True
|
||||
when: admin_console_enabled | bool and nginx_enabled | bool
|
||||
|
||||
- name: Disable apache port {{ apache_port }} localhost only
|
||||
file:
|
||||
path: /etc/{{ apache_service }}/ports.conf
|
||||
state: absent
|
||||
when: not nginx_enabled | bool
|
||||
|
||||
# the below slides in nginx's proxypass config files for apache on localhost
|
||||
# via the ports.conf file installed above
|
||||
- name: Install proxpass to apache running on localhost port {{ apache_port }}
|
||||
include_tasks: uses_apache.yml
|
||||
when: nginx_enabled | bool
|
||||
|
||||
# the below task contains the same logic contained in the playbooks to enable
|
||||
# 'runrole nginx' to do the right thing.
|
||||
- name: Install proxpass to apache running on localhost
|
||||
# 'runrole nginx' to do the right thing but with the 'src' path set to role's
|
||||
# templates path ie roles/<rolename>/template/
|
||||
|
||||
- name: Install proxpass to other services 'dual mode' roles
|
||||
include_tasks: only_nginx.yml
|
||||
when: nginx_enabled | bool
|
||||
|
||||
- name: Stop and disable nginx when not nginx_enabled
|
||||
systemd:
|
||||
name: nginx
|
||||
state: stopped
|
||||
enabled: false
|
||||
when: not nginx_enabled | bool
|
||||
|
||||
- name: Disable apache port {{ apache_port }} localhost only
|
||||
template:
|
||||
dest: /etc/{{ apache_service }}/ports.conf
|
||||
src: stock-apache-ports.conf
|
||||
when: not nginx_enabled | bool
|
||||
|
||||
# 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
|
||||
include_tasks: disable.yml
|
||||
when: not nginx_enabled | bool
|
||||
|
||||
- name: Since we stopped apache2, start it again
|
||||
systemd:
|
||||
|
|
16
roles/nginx/templates/stock-apache-ports.conf
Normal file
16
roles/nginx/templates/stock-apache-ports.conf
Normal file
|
@ -0,0 +1,16 @@
|
|||
# If you just change the port or add more ports here, you will likely also
|
||||
# have to change the VirtualHost statement in
|
||||
# /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
Listen 80
|
||||
|
||||
<IfModule ssl_module>
|
||||
Listen 443
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_gnutls.c>
|
||||
Listen 443
|
||||
</IfModule>
|
||||
|
||||
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
||||
|
Loading…
Reference in a new issue