fix(service): don't reload ufw service if service is disabledtags/v0.5.5
@@ -8,6 +8,8 @@ | |||
{%- set sls_reload_service = tplroot ~ '.service.reload' %} | |||
{%- from tplroot ~ "/map.jinja" import ufw with context %} | |||
{%- set enabled = ufw.get('enabled', False) %} | |||
include: | |||
- {{ sls_package_install }} | |||
- {{ sls_enable_service }} | |||
@@ -44,8 +46,9 @@ ufw-app-{{ method }}-{{ app_name }}: | |||
{%- if comment is not none and salt['grains.get']('osfinger') != 'Debian-8' and salt['grains.get']('osfinger') != 'CentOS-6' %} | |||
- comment: '"{{ comment }}"' | |||
{%- endif %} | |||
{%- if enabled %} | |||
- listen_in: | |||
- cmd: reload-ufw | |||
{%- endif %} | |||
{%- endfor %} | |||
{%- endfor %} |
@@ -8,6 +8,8 @@ | |||
{%- set sls_reload_service = tplroot ~ '.service.reload' %} | |||
{%- from tplroot ~ "/map.jinja" import ufw with context %} | |||
{%- set enabled = ufw.get('enabled', False) %} | |||
include: | |||
- {{ sls_package_install }} | |||
- {{ sls_enable_service }} | |||
@@ -23,7 +25,8 @@ ufw-interface-{{ interface_name }}: | |||
{%- if comment is not none %} | |||
- comment: '"{{ comment }}"' | |||
{%- endif %} | |||
{%- if enabled %} | |||
- listen_in: | |||
- cmd: reload-ufw | |||
{%- endif %} | |||
{%- endfor %} |
@@ -8,6 +8,8 @@ | |||
{%- set sls_reload_service = tplroot ~ '.service.reload' %} | |||
{%- from tplroot ~ "/map.jinja" import ufw with context %} | |||
{%- set enabled = ufw.get('enabled', False) %} | |||
include: | |||
- {{ sls_package_install }} | |||
- {{ sls_enable_service }} | |||
@@ -23,7 +25,8 @@ ufw-open-{{ open_addr }}: | |||
{%- if comment is not none %} | |||
- comment: '"{{ comment }}"' | |||
{%- endif %} | |||
{%- if enabled %} | |||
- listen_in: | |||
- cmd: reload-ufw | |||
{%- endif %} | |||
{%- endfor %} |
@@ -8,6 +8,8 @@ | |||
{%- set sls_reload_service = tplroot ~ '.service.reload' %} | |||
{%- from tplroot ~ "/map.jinja" import ufw with context %} | |||
{%- set enabled = ufw.get('enabled', False) %} | |||
include: | |||
- {{ sls_package_install }} | |||
- {{ sls_enable_service }} | |||
@@ -49,8 +51,9 @@ ufw-svc-{{ method }}-{{ service_name }}-{{ from_addr }}: | |||
- comment: '"{{ comment }}"' | |||
{%- endif %} | |||
- to_port: "{{ to_port }}" | |||
{%- if enabled %} | |||
- listen_in: | |||
- cmd: reload-ufw | |||
{%- endif %} | |||
{%- endfor %} | |||
{%- endfor %} |