ansible-role-nginx/tasks/config/modify-systemd.yml
Alessandro Fael Garcia 8b41c27cb5
Improve the error formatting when there's a syntax error (#324)
And remove the debug tasks messages.
2020-09-18 19:51:50 +02:00

38 lines
1.1 KiB
YAML

---
- name: "Create override directory for NGINX systemd service"
file:
path: "{{ nginx_service_overridepath }}"
state: directory
mode: 0755
- name: "Create override for NGINX systemd service"
template:
src: "{{ role_path }}/templates/services/nginx.service.override.conf.j2"
dest: "{{ nginx_service_overridepath }}/{{ nginx_service_overridefilename }}"
owner: root
group: root
mode: 0644
when:
- not nginx_service_custom | bool
- not nginx_service_clean | bool
notify: "(Handler) Systemd daemon-reload"
- name: "Customize override for NGINX systemd service"
copy:
src: "{{ nginx_service_custom_file }}"
dest: "{{ nginx_service_overridepath }}/{{ nginx_service_overridefilename }}"
owner: root
group: root
mode: 0644
when:
- nginx_service_custom | bool
- not nginx_service_clean | bool
notify: "(Handler) Systemd daemon-reload"
- name: "Remove override for NGINX systemd service"
file:
path: "{{ nginx_service_overridepath }}"
state: absent
when: nginx_service_clean | bool
notify: "(Handler) Systemd daemon-reload"