Browse Source

Allow multiple configurations for the same port

tags/v0.2.0
Janek Bevendorff 6 years ago
parent
commit
9e950edaa0
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      ufw/init.sls

+ 2
- 1
ufw/init.sls View File

{%- set method = 'deny' if deny else ('limit' if limit else 'allow') -%} {%- set method = 'deny' if deny else ('limit' if limit else 'allow') -%}
{%- set from_port = service_details.get('from_port', None) %} {%- set from_port = service_details.get('from_port', None) %}
{%- set to_addr = service_details.get('to_addr', None) %} {%- set to_addr = service_details.get('to_addr', None) %}
{%- set to_port = service_details.get('to_port', service_name) %}
{%- set comment = service_details.get('comment', None) %} {%- set comment = service_details.get('comment', None) %}


ufw-svc-{{method}}-{{service_name}}-{{from_addr}}: ufw-svc-{{method}}-{{service_name}}-{{from_addr}}:
{%- if comment != None %} {%- if comment != None %}
- comment: '"{{comment}}"' - comment: '"{{comment}}"'
{%- endif %} {%- endif %}
- to_port: "{{service_name}}"
- to_port: "{{to_port}}"
- require: - require:
- pkg: ufw - pkg: ufw
- listen_in: - listen_in:

Loading…
Cancel
Save