nginx-unit/tasks/main.yml

27 lines
686 B
YAML
Raw Normal View History

2023-10-05 00:31:23 +03:00
---
- name: Nginx Unit | Install packages
package:
2023-10-05 00:56:38 +03:00
name: "{{ nginx_unit_packages }}"
2023-10-05 00:31:23 +03:00
state: present
- name: Nginx Unit | Deploy config
copy:
dest: "{{ nginx_unit_config_path }}"
2023-10-05 14:17:00 +03:00
# https://stackoverflow.com/questions/38392491/ansible-remove-whitespaces-in-json-file
# unit saves json minified, so to achieve idempotence we need to do it too
content: "{{ nginx_unit_config | to_json(separators=(',',':')) }}"
2023-10-05 00:31:23 +03:00
mode: "600"
owner: root
group: root
notify: Nginx Unit | Load configuration
- name: Nginx Unit | Enable and start
service:
name: unit
state: started
2023-10-05 00:56:38 +03:00
enabled: yes
2023-10-05 00:31:23 +03:00
- name: Nginx Unit | Run handlers
meta: flush_handlers