{% if role <= 3 %}
{% if not is_serv_protected or role <= 2 %}
Edit
{% endif %}
{% endif %}
Expand all
{% set i = 0 -%}
{% set section_name = {} %}
{% for line in conf -%}
{% set i = i + loop.index0 %}
{% if not role %}
{% if line.startswith('#HideBlockStart') %}
{% continue %}
{% endif %}
{% endif %}
{% if service == 'nginx' %}
{%- if "server {" in line -%}
{% if i > 1 %}
{% endif %}
{{ line }}
{% continue %}
{% endif %}
{%- if "stream {" in line -%}
{% if i > 1 %}
{% endif %}
{{ line }}
{% continue %}
{% endif %}
{% if "listen " in line or "location" in line or "server_name" in line or "}" in line %}
{% if "#" not in line %}
{{ i }}
{{ line }}
{% continue %}
{% endif %}
{% endif %}
{% if "#" in line %}
{{ i }}
{{ line }}
{% continue %}
{% endif %}
{% if line|length > 1 %}
{{ i }}
{{ line }}
{% endif %}
{% elif service == 'keepalived' %}
{%- if "global_defs {" in line -%}
{% if i > 1 %}
{% endif %}
{{ line }}
{% continue %}
{% endif %}
{%- if "vrrp_instance " in line -%}
{% if i > 1 %}
{% endif %}
{{ line }}
{% continue %}
{% endif %}
{%- if "vrrp_script " in line -%}
{% if i > 1 %}
{% endif %}
{{ line }}
{% continue %}
{% endif %}
{% if "state " in line or "interface" in line or "priority" in line or "}" in line %}
{% if "#" not in line %}
{{ i }}
{{ line }}
{% continue %}
{% endif %}
{% endif %}
{% if "#" in line %}
{{ i }}
{{ line }}
{% continue %}
{% endif %}
{% if line|length > 1 %}
{{ i }}
{{ line }}
{% endif %}
{% else %}
{% if line.startswith('global') %}
{{ line }}
{% if role %}
{% if service != 'keepalived' %}
Edit
{% endif %}
{% endif %}
{% continue %}
{% endif %}
{% if line.startswith('defaults') %}
{% continue %}
{% endif %}
{%- if line.startswith('listen') -%}
{{- line -}}
{% if role %}
Edit/Delete
{% endif %}
{%- set backend = line.split(' ') -%}
Stats
{%- set backend = backend|join('_') -%}
{%- do section_name.update({i: backend}) -%}
{% continue %}
{%- endif -%}
{%- if line.startswith('frontend') -%}
{{ line }}
{% if role %}
Edit/Delete
{% endif %}
{% set backend = line.split(' ') %}
Stats
{% set backend = backend|join('_') %}
{% do section_name.update({i: backend}) %}
{% continue %}
{%- endif -%}
{% if line.startswith('backend') %}
{{ line }}
{% if role %}
Edit/Delete
{% endif %}
{% set backend = line.split(' ') %}
Stats
{% continue %}
{% endif %}
{% if line.startswith('cache') %}
{% continue %}
{% endif %}
{% if "acl" in line or "option" in line or "server" in line %}
{% if "timeout" not in line and "default-server" not in line and "#use_backend" not in line and "#" not in line%}
{{ i }}
{{ line }}
{% continue %}
{% endif %}
{% endif %}
{% if line.startswith("#") %}
{{ i }}
{{ line }}
{% continue %}
{% endif %}
{% if line|length > 1 %}
{{ i }}
{{ line }}
{% endif %}
{%- if "bind" in line -%}
{%- set bind = line.split(':')[1] -%}
{%- set bind = bind.split(' ') -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{% if configver %}
{% if role <= 3 %}
{% if not is_serv_protected or role <= 2 %}
{% endif %}
{% endif %}
Note: If you reconfigure Master server, Slave will reconfigured automatically