2020-06-30 18:59:53 +02:00
|
|
|
---
|
2020-09-19 17:32:17 +02:00
|
|
|
- name: Create override directory for NGINX systemd service
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.file:
|
2020-06-30 18:59:53 +02:00
|
|
|
path: "{{ nginx_service_overridepath }}"
|
|
|
|
state: directory
|
2020-08-19 18:39:17 +02:00
|
|
|
mode: 0755
|
2020-06-30 18:59:53 +02:00
|
|
|
|
2020-09-19 17:32:17 +02:00
|
|
|
- name: Create override for NGINX systemd service
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.template:
|
2020-06-30 18:59:53 +02:00
|
|
|
src: "{{ role_path }}/templates/services/nginx.service.override.conf.j2"
|
|
|
|
dest: "{{ nginx_service_overridepath }}/{{ nginx_service_overridefilename }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
2020-08-19 18:39:17 +02:00
|
|
|
mode: 0644
|
2020-06-30 18:59:53 +02:00
|
|
|
when:
|
2020-08-19 18:39:17 +02:00
|
|
|
- not nginx_service_custom | bool
|
|
|
|
- not nginx_service_clean | bool
|
2020-09-19 17:32:17 +02:00
|
|
|
notify: (Handler) Systemd daemon-reload
|
2020-06-30 18:59:53 +02:00
|
|
|
|
2020-09-19 17:32:17 +02:00
|
|
|
- name: Customize override for NGINX systemd service
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.copy:
|
2020-06-30 18:59:53 +02:00
|
|
|
src: "{{ nginx_service_custom_file }}"
|
|
|
|
dest: "{{ nginx_service_overridepath }}/{{ nginx_service_overridefilename }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
2020-08-19 18:39:17 +02:00
|
|
|
mode: 0644
|
2020-06-30 18:59:53 +02:00
|
|
|
when:
|
2020-08-19 18:39:17 +02:00
|
|
|
- nginx_service_custom | bool
|
|
|
|
- not nginx_service_clean | bool
|
2020-09-19 17:32:17 +02:00
|
|
|
notify: (Handler) Systemd daemon-reload
|
2020-06-30 18:59:53 +02:00
|
|
|
|
2020-09-19 17:32:17 +02:00
|
|
|
- name: Remove override for NGINX systemd service
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.file:
|
2020-06-30 18:59:53 +02:00
|
|
|
path: "{{ nginx_service_overridepath }}"
|
|
|
|
state: absent
|
2020-08-19 18:39:17 +02:00
|
|
|
when: nginx_service_clean | bool
|
2020-09-19 17:32:17 +02:00
|
|
|
notify: (Handler) Systemd daemon-reload
|