20 lines
673 B
YAML
20 lines
673 B
YAML
|
---
|
||
|
- block:
|
||
|
- name: Create the snippets directory
|
||
|
file: dest={{ nginx_snippets_dir }} state=directory
|
||
|
|
||
|
- name: remove nginx default virtualhost
|
||
|
file: dest=/etc/nginx/sites-enabled/default state=absent
|
||
|
notify: Reload nginx
|
||
|
|
||
|
- name: Install the supported configuration snippets
|
||
|
template: src={{ item }}.j2 dest=/etc/nginx/snippets/{{ item }} owner=root group=root mode=0444
|
||
|
with_items: '{{ nginx_conf_snippets }}'
|
||
|
|
||
|
- name: Install the main nginx.conf
|
||
|
template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf mode=444
|
||
|
notify: Reload nginx
|
||
|
|
||
|
when: nginx_enabled
|
||
|
tags: [ 'nginx', 'nginx_conf', 'nginx_virtualhost' ]
|