diff --git a/nginx/servers_config.sls b/nginx/servers_config.sls index 5dd11a9..6652d64 100644 --- a/nginx/servers_config.sls +++ b/nginx/servers_config.sls @@ -10,8 +10,8 @@ {% set server_states = [] %} {#- _nginx is a lightened copy of nginx map intended to passed in templates #} {%- set _nginx = nginx.copy() %} -{%- do _nginx.pop('snippets') %} -{%- do _nginx.pop('servers') %} +{%- do _nginx.pop('snippets') if nginx.snippets is defined %} +{%- do _nginx.pop('servers') if nginx.servers is defined %} # Simple path concatenation. # Needs work to make this function on windows. diff --git a/nginx/snippets.sls b/nginx/snippets.sls index d09ba36..f19905b 100644 --- a/nginx/snippets.sls +++ b/nginx/snippets.sls @@ -8,8 +8,8 @@ {#- _nginx is a lightened copy of nginx map intended to passed in templates #} {%- set _nginx = nginx.copy() %} -{%- do _nginx.pop('snippets') %} -{%- do _nginx.pop('servers') %} +{%- do _nginx.pop('snippets') if nginx.snippets is defined %} +{%- do _nginx.pop('servers') if nginx.servers is defined %} nginx_snippets_dir: file.directory: