Browse Source

feat(servers_config): craft states ids with `server`

instead of `loop.index0` to get states easier to extend

BREAKING CHANGES: All `server_conf_{int}` and `server_state_{int}` will be renamed
to `nginx_{server}_server_config_file` and `nginx_{server}_server_state_symlink`
respectively
pull/297/head
sticky-note 2 years ago
parent
commit
ed23070fc1
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      nginx/servers_config.sls

+ 2
- 2
nginx/servers_config.sls View File



# Managed enabled/disabled state for servers # Managed enabled/disabled state for servers
{% for server, settings in nginx.servers.managed.items() %} {% for server, settings in nginx.servers.managed.items() %}
{% set conf_state_id = 'server_conf_' ~ loop.index0 %}
{%- set conf_state_id = 'nginx_' ~ server ~ '_server_config_file' %}
{% if 'deleted' in settings and settings.deleted %} {% if 'deleted' in settings and settings.deleted %}
{{ conf_state_id }}: {{ conf_state_id }}:
file.absent: file.absent:
{% endif %} {% endif %}


{% if settings.enabled != None %} {% if settings.enabled != None %}
{% set status_state_id = 'server_state_' ~ loop.index0 %}
{%- set status_state_id = 'nginx_' ~ server ~ '_server_state_symlink' %}
{%- set enabled_dir = path_join(server, nginx.servers.managed.get(server).get('enabled_dir', nginx.lookup.server_enabled)) -%} {%- 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)) -%} {%- set available_dir = path_join(server, nginx.servers.managed.get(server).get('available_dir', nginx.lookup.server_available)) -%}
{%- if enabled_dir != available_dir %} {%- if enabled_dir != available_dir %}

Loading…
Cancel
Save