Fix failures due to undefined variables
Change-Id: I206ef2f86bd9f4254fafc509355f08389388f89f
diff --git a/nginx/meta/sphinx.yml b/nginx/meta/sphinx.yml
index 72d75ce..20d1056 100644
--- a/nginx/meta/sphinx.yml
+++ b/nginx/meta/sphinx.yml
@@ -13,11 +13,11 @@
value: {{ server.bind.address }}
endpoint:
{%- for site_name, site in server.get('site', {}).iteritems() %}
- {%- if site.enabled %}
+ {%- if site.get('enabled') %}
{{ site_name }}_{{ site.type }}:
name: {{ site_name }}
type: {{ site.type }}
address: http{% if site.get('ssl', {}).get('enabled', False) %}s{% endif %}://{{ site.host.name }}:{{ site.host.get('port', '80') }}/
protocol: http{% if site.get('ssl', {}).get('enabled', False) %}s{% endif %}
{%- endif %}
- {%- endfor %}
\ No newline at end of file
+ {%- endfor %}
diff --git a/nginx/server/sites.sls b/nginx/server/sites.sls
index fb35732..5ccf27e 100644
--- a/nginx/server/sites.sls
+++ b/nginx/server/sites.sls
@@ -3,7 +3,7 @@
{%- set ssl_certificates = {} %}
{%- for site_name, site in server.get('site', {}).iteritems() %}
-{%- if site.enabled %}
+{%- if site.get('enabled') %}
{%- if site.get('ssl', {'enabled': False}).enabled and site.host.name not in ssl_certificates.keys() %}
{%- set _dummy = ssl_certificates.update({site.host.name: []}) %}