Browse Source

fix(service): don't reload ufw service if service is disabled

tags/v0.5.5
Nicolas Rodriguez 4 years ago
parent
commit
c953630e5f
4 changed files with 16 additions and 4 deletions
  1. +4
    -1
      ufw/config/applications.sls
  2. +4
    -1
      ufw/config/interfaces.sls
  3. +4
    -1
      ufw/config/open.sls
  4. +4
    -1
      ufw/config/services.sls

+ 4
- 1
ufw/config/applications.sls View File

{%- set sls_reload_service = tplroot ~ '.service.reload' %} {%- set sls_reload_service = tplroot ~ '.service.reload' %}
{%- from tplroot ~ "/map.jinja" import ufw with context %} {%- from tplroot ~ "/map.jinja" import ufw with context %}


{%- set enabled = ufw.get('enabled', False) %}

include: include:
- {{ sls_package_install }} - {{ sls_package_install }}
- {{ sls_enable_service }} - {{ sls_enable_service }}
{%- if comment is not none and salt['grains.get']('osfinger') != 'Debian-8' and salt['grains.get']('osfinger') != 'CentOS-6' %} {%- if comment is not none and salt['grains.get']('osfinger') != 'Debian-8' and salt['grains.get']('osfinger') != 'CentOS-6' %}
- comment: '"{{ comment }}"' - comment: '"{{ comment }}"'
{%- endif %} {%- endif %}
{%- if enabled %}
- listen_in: - listen_in:
- cmd: reload-ufw - cmd: reload-ufw
{%- endif %}
{%- endfor %} {%- endfor %}
{%- endfor %} {%- endfor %}

+ 4
- 1
ufw/config/interfaces.sls View File

{%- set sls_reload_service = tplroot ~ '.service.reload' %} {%- set sls_reload_service = tplroot ~ '.service.reload' %}
{%- from tplroot ~ "/map.jinja" import ufw with context %} {%- from tplroot ~ "/map.jinja" import ufw with context %}


{%- set enabled = ufw.get('enabled', False) %}

include: include:
- {{ sls_package_install }} - {{ sls_package_install }}
- {{ sls_enable_service }} - {{ sls_enable_service }}
{%- if comment is not none %} {%- if comment is not none %}
- comment: '"{{ comment }}"' - comment: '"{{ comment }}"'
{%- endif %} {%- endif %}
{%- if enabled %}
- listen_in: - listen_in:
- cmd: reload-ufw - cmd: reload-ufw
{%- endif %}
{%- endfor %} {%- endfor %}

+ 4
- 1
ufw/config/open.sls View File

{%- set sls_reload_service = tplroot ~ '.service.reload' %} {%- set sls_reload_service = tplroot ~ '.service.reload' %}
{%- from tplroot ~ "/map.jinja" import ufw with context %} {%- from tplroot ~ "/map.jinja" import ufw with context %}


{%- set enabled = ufw.get('enabled', False) %}

include: include:
- {{ sls_package_install }} - {{ sls_package_install }}
- {{ sls_enable_service }} - {{ sls_enable_service }}
{%- if comment is not none %} {%- if comment is not none %}
- comment: '"{{ comment }}"' - comment: '"{{ comment }}"'
{%- endif %} {%- endif %}
{%- if enabled %}
- listen_in: - listen_in:
- cmd: reload-ufw - cmd: reload-ufw
{%- endif %}
{%- endfor %} {%- endfor %}

+ 4
- 1
ufw/config/services.sls View File

{%- set sls_reload_service = tplroot ~ '.service.reload' %} {%- set sls_reload_service = tplroot ~ '.service.reload' %}
{%- from tplroot ~ "/map.jinja" import ufw with context %} {%- from tplroot ~ "/map.jinja" import ufw with context %}


{%- set enabled = ufw.get('enabled', False) %}

include: include:
- {{ sls_package_install }} - {{ sls_package_install }}
- {{ sls_enable_service }} - {{ sls_enable_service }}
- comment: '"{{ comment }}"' - comment: '"{{ comment }}"'
{%- endif %} {%- endif %}
- to_port: "{{ to_port }}" - to_port: "{{ to_port }}"
{%- if enabled %}
- listen_in: - listen_in:
- cmd: reload-ufw - cmd: reload-ufw
{%- endif %}
{%- endfor %} {%- endfor %}
{%- endfor %} {%- endfor %}

Loading…
Cancel
Save