2016-07-03 12:19:12 +02:00
|
|
|
---
|
2017-11-07 00:09:01 +01:00
|
|
|
- block:
|
|
|
|
- name: Create the nginx webroot if different from the default
|
2017-11-07 12:37:14 +01:00
|
|
|
file: dest={{ nginx_webroot }} state=directory mode=0755
|
2017-11-07 00:09:01 +01:00
|
|
|
when: nginx_webroot != '/usr/share/nginx/html'
|
|
|
|
|
|
|
|
- name: Install the nginx virtualhost files
|
|
|
|
template: src=nginx-virthost.j2 dest=/etc/nginx/sites-available/{{ item.virthost_name }} owner=root group=root mode=0444
|
|
|
|
with_items: '{{ nginx_virthosts | default(omit) }}'
|
|
|
|
notify: Reload nginx
|
|
|
|
|
|
|
|
- name: Enable the nginx virtualhosts
|
|
|
|
file: src=/etc/nginx/sites-available/{{ item.virthost_name }} dest=/etc/nginx/sites-enabled/{{ item.virthost_name }} state=link
|
|
|
|
with_items: '{{ nginx_virthosts | default(omit) }}'
|
|
|
|
notify: Reload nginx
|
2016-07-03 12:19:12 +02:00
|
|
|
|
|
|
|
tags: [ 'nginx', 'virtualhost' ]
|