Deleted vhost don't need a template

pull/14/head 1.0.8
Emilien Mantel 2015-11-30 12:16:17 +01:00
parent bfe4a315f9
commit 1d56fc249d
3 changed files with 9 additions and 4 deletions

View File

@ -55,7 +55,7 @@ You can see many examples in: [tests/test.yml](tests/test.yml).
#### Common
- `name`: (M) Domain or list of domain used.
- `template`: (M) template used to create vhost
- `template`: (M) template used to create vhost. Optional if you set `delete` to true.
- `enable`: (O) Enable the vhost (default is true)
- `delete`: (O) Delete the vhost (default is false)
- `redirect_from`: (O) Domain list to redirect to the first `name`. You can use this key to redirect non-www to www

View File

@ -13,7 +13,10 @@
group={{ item.group | default('www-data') }}
mode={{ item.mode | default('0755') }}
with_items: nginx_vhosts
when: item.root is not defined and item.template != '_proxy'
when: >
item.root is not defined and
(item.template is defined and item.template != '_proxy') and
(item.delete is not defined or not item.delete)
- name: FILE | Create root public folders (foreach nginx_vhosts)
file: >
@ -23,7 +26,10 @@
group={{ item.group | default('www-data') }}
mode={{ item.mode | default('0755') }}
with_items: nginx_vhosts
when: item.root is not defined and item.template != '_proxy'
when: >
item.root is not defined and
(item.template is defined and item.template != '_proxy') and
(item.delete is not defined or not item.delete)
- name: TEMPLATE | Create vhosts
template: >

View File

@ -49,7 +49,6 @@
template: '_proxy'
upstream_name: 'test'
- name: 'deleted.local'
template: '_base'
delete: true
roles:
- ../../