Commit 028fa237 authored by Nico's avatar Nico
Browse files

revproxy: default to enabled vhost

Avoid having to specify "enabled: true" in every vhost, just default to
enabled.
parent ba22f409
......@@ -4,7 +4,7 @@
line: "{{ vhost.domain }}"
path: /etc/dehydrated/domains.txt
create: true
state: "{{ vhost.enabled|ternary('present', 'absent') }}"
state: "{{ vhost.enabled|default(True)|ternary('present', 'absent') }}"
notify:
- renew certificates
......@@ -13,14 +13,14 @@
- name: "Ensuring VHost Configuration {{ vhost.domain }} is absent on disabled VHost"
file:
path: /etc/nginx/sites-enabled/{{ vhost.domain }}.conf
path: "/etc/nginx/sites-enabled/{{ vhost.domain }}.conf"
state: absent
when: vhost.enabled != true
when: vhost.enabled is defined and vhost.enabled != true
notify:
- restart nginx
- name: "Generating VHost Configuration {{ vhost.domain }}"
template: src=vhosts.conf dest=/etc/nginx/sites-enabled/{{ vhost.domain }}.conf
when: vhost.enabled == true
when: vhost.enabled is not defined or vhost.enabled == true
notify:
- restart nginx
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment