computer-playbook/roles/nginx/tasks/main.yml

22 lines
496 B
YAML
Raw Normal View History

2020-12-24 14:27:31 +01:00
---
- name: install nginx
pacman: name=nginx state=present
notify: restart nginx
- name: Ensure nginx configuration directories are present
2020-12-24 14:27:31 +01:00
file:
path: "{{ item }}"
2020-12-24 14:27:31 +01:00
state: directory
mode: '0755'
loop:
- "{{nginx_servers_directory}}"
- "{{nginx_maps_directory}}"
- "{{nginx_upstreams_directory}}"
2020-12-24 14:27:31 +01:00
- name: create nginx config file
template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf
2020-12-24 14:27:31 +01:00
notify: restart nginx
- name: flush nginx service
meta: flush_handlers