2020-05-17 00:40:01 +00:00
- name : Ensure that Apache ({{ apache_service }}) is not running -- we may need port swap
2020-02-12 08:08:16 +00:00
systemd :
2020-02-12 11:57:14 +00:00
name : "{{ apache_service }}" # apache2 or httpd, per /opt/iiab/iiab/vars/<OS>.yml
2020-02-12 08:08:16 +00:00
state : stopped
2020-05-17 05:06:48 +00:00
ignore_errors : yes
2020-05-22 05:12:07 +00:00
# 'when: apache_installed is defined' might also work, as mysql's php no longer installs apache2 (but 'ignore_errors: yes' remains safer!)
2020-02-12 08:08:16 +00:00
- name : Install /etc/{{ apache_service }}/ports.conf from template 1 of 2 (ports.conf.j2) if nginx_enabled, to enable Apache port {{ apache_port }} localhost only
template :
src : ports.conf.j2
2020-02-13 01:53:36 +00:00
dest : "/etc/{{ apache_service }}/ports.conf"
2020-10-16 20:46:19 +00:00
when : nginx_enabled
2020-02-12 08:08:16 +00:00
- name : Install /etc/{{ apache_service }}/ports.conf from template 2 of 2 (stock-apache-ports.conf) if not nginx_enabled, to disable Apache port {{ apache_port }} localhost only
template :
src : stock-apache-ports.conf
2020-02-13 01:53:36 +00:00
dest : "/etc/{{ apache_service }}/ports.conf"
2020-02-12 08:08:16 +00:00
when : not nginx_enabled
2020-05-17 03:50:22 +00:00
- name : Enable & Restart '{{ apache_service }}' if Apache is installed and enabled, since we stopped it
2020-02-12 08:08:16 +00:00
systemd :
2020-02-12 11:57:14 +00:00
name : "{{ apache_service }}" # apache2 or httpd, per /opt/iiab/iiab/vars/<OS>.yml
2020-02-12 08:08:16 +00:00
daemon_reload : yes
state : restarted
enabled : true
2020-05-17 00:40:01 +00:00
when : apache_installed is defined and apache_enabled # or not nginx_enabled
2020-02-12 08:08:16 +00:00
- name : Enable & (Re)Start 'nginx' systemd service, if nginx_enabled
systemd :
name : nginx
daemon_reload : yes
enabled : yes
state : restarted
2020-10-16 20:46:19 +00:00
when : nginx_enabled
2020-02-12 08:08:16 +00:00
- name : Disable & Stop 'nginx' systemd service, if not nginx_enabled
systemd :
name : nginx
enabled : no
state : stopped
when : not nginx_enabled