Merge pull request #176 from Perceptyx/fix_pr_172

Fix for PR #172
This commit is contained in:
Niels Abspoel 2017-12-22 16:47:28 +01:00 committed by GitHub
commit 896fdee0dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -126,6 +126,9 @@ nginx_server_available_dir:
{% if settings.enabled != None %} {% if settings.enabled != None %}
{% set status_state_id = 'server_state_' ~ loop.index0 %} {% set status_state_id = 'server_state_' ~ loop.index0 %}
{%- set enabled_dir = path_join(server, nginx.servers.managed.get(server).get('enabled_dir', nginx.lookup.server_enabled)) -%}
{%- set available_dir = path_join(server, nginx.servers.managed.get(server).get('available_dir', nginx.lookup.server_available)) -%}
{%- if enabled_dir != available_dir %}
{{ status_state_id }}: {{ status_state_id }}:
{% if 'deleted' in settings and settings.deleted %} {% if 'deleted' in settings and settings.deleted %}
{{ manage_status(server, False, True) }} {{ manage_status(server, False, True) }}
@ -140,5 +143,6 @@ nginx_server_available_dir:
{% if 'deleted' not in settings or ( 'deleted' in settings and settings.deleted == False ) %} {% if 'deleted' not in settings or ( 'deleted' in settings and settings.deleted == False ) %}
{% do server_states.append(status_state_id) %} {% do server_states.append(status_state_id) %}
{% endif %} {% endif %}
{%- endif %} {# enabled != available_dir #}
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@ -152,6 +152,25 @@ nginx:
config: config:
source_path: salt://path-to-site-file/mysite2 source_path: salt://path-to-site-file/mysite2
# Below configuration becomes handy if you want to create custom configuration files
# for example if you want to create /usr/local/etc/nginx/http_options.conf with
# the following content:
# sendfile on;
# tcp_nopush on;
# tcp_nodelay on;
# send_iowait 12000;
http_options.conf:
enabled: True
available_dir: /usr/local/etc/nginx
enabled_dir: /usr/local/etc/nginx
config:
- sendfile: 'on'
- tcp_nopush: 'on'
- tcp_nodelay: 'on'
- send_iowait: 12000
certificates_path: '/etc/nginx/ssl' # Use this if you need to deploy below certificates in a custom path. certificates_path: '/etc/nginx/ssl' # Use this if you need to deploy below certificates in a custom path.
# If you're doing SSL termination, you can deploy certificates this way. # If you're doing SSL termination, you can deploy certificates this way.
# The private one(s) should go in a separate pillar file not in version # The private one(s) should go in a separate pillar file not in version