Saltstack Official FirewallD Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1KB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <service>
  3. {%- if 'short' in service %}<short>{{ service.short }}</short>{%- else %}<short>{{ name }}</short>{%- endif %}
  4. {%- if 'description' in service %}<description>{{ service.description }}</description>{%- endif %}
  5. {%- if 'ports' in service %}
  6. {%- if 'tcp' in service.ports %}
  7. {%- for v in service.ports.tcp %}
  8. <port port="{{ v }}" protocol="tcp" />
  9. {%- endfor %}
  10. {%- endif %}
  11. {%- if 'udp' in service.ports %}
  12. {%- for v in service.ports.udp %}
  13. <port port="{{ v }}" protocol="udp" />
  14. {%- endfor %}
  15. {%- endif %}
  16. {%- if 'modules' in service %}
  17. {%- for v in service.modules %}
  18. <module name="{{ v }}" />
  19. {%- endfor %}
  20. {%- endif %}
  21. {%- endif %}
  22. {%- if 'destinations' in service %}
  23. {%- if 'ipv4' in service.destinations %}
  24. {%- for v in service.destinations.ipv4 %}
  25. <destination ipv4="{{ v }}" />
  26. {%- endfor %}
  27. {%- endif %}
  28. {%- if 'ipv6' in service.destinations %}
  29. {%- for v in service.destinations.ipv6 %}
  30. <destination ipv6="{{ v }}" />
  31. %- endfor %}
  32. {%- endif %}
  33. {%- endif %}
  34. </service>