mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
40 lines
1.3 KiB
YAML
40 lines
1.3 KiB
YAML
- name: Ensure that Apache (({{ apache_service }})) is not running -- we may need port swap
|
|
systemd:
|
|
name: "{{ apache_service }}"
|
|
state: stopped
|
|
|
|
- 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
|
|
dest: "/etc/{{ apache_service }}/ports.conf"
|
|
when: nginx_enabled | bool
|
|
|
|
- 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
|
|
dest: "/etc/{{ apache_service }}/ports.conf"
|
|
when: not nginx_enabled
|
|
|
|
- name: Enable & Restart '{{ apache_service }}' if apache_enabled or not nginx_enabled, since we stopped it
|
|
systemd:
|
|
name: "{{ apache_service }}"
|
|
daemon_reload: yes
|
|
state: restarted
|
|
enabled: true
|
|
when: apache_enabled or not nginx_enabled
|
|
|
|
|
|
- name: Enable & (Re)Start 'nginx' systemd service, if nginx_enabled
|
|
systemd:
|
|
name: nginx
|
|
daemon_reload: yes
|
|
enabled: yes
|
|
state: restarted
|
|
when: nginx_enabled | bool
|
|
|
|
- name: Disable & Stop 'nginx' systemd service, if not nginx_enabled
|
|
systemd:
|
|
name: nginx
|
|
enabled: no
|
|
state: stopped
|
|
when: not nginx_enabled
|