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.

83 lines
2.4KB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. This file is managed/generated by salt.
  4. Do not edit this file manually, it will be overwritten!
  5. Modify the salt pillar for firewalld instead
  6. -->
  7. <service version="1">
  8. {%- if 'short' in service %}
  9. <short>{{ service.short }}</short>
  10. {%- else %}
  11. <short>{{ name }}</short>
  12. {%- endif %}
  13. {%- if 'description' in service %}
  14. <description>{{ service.description }}</description>
  15. {%- endif %}
  16. {%- if 'ports' in service %}
  17. {%- if 'tcp' in service.ports %}
  18. {%- for v in service.ports.tcp %}
  19. <port port="{{ v }}" protocol="tcp" />
  20. {%- endfor %}
  21. {%- endif %}
  22. {%- if 'udp' in service.ports %}
  23. {%- for v in service.ports.udp %}
  24. <port port="{{ v }}" protocol="udp" />
  25. {%- endfor %}
  26. {%- endif %}
  27. {%- if 'sctp' in service.ports %}
  28. {%- for v in service.ports.sctp %}
  29. <port port="{{ v }}" protocol="sctp" />
  30. {%- endfor %}
  31. {%- endif %}
  32. {%- if 'dccp' in service.ports %}
  33. {%- for v in service.ports.dccp %}
  34. <port port="{{ v }}" protocol="dccp" />
  35. {%- endfor %}
  36. {%- endif %}
  37. {%- endif %}
  38. {%- if 'protocols' in service %}
  39. {%- for v in service.protocols %}
  40. <protocol value="{{ v }}" />
  41. {%- endfor %}
  42. {%- endif %}
  43. {%- if 'source_ports' in service %}
  44. {%- if 'tcp' in service.source_ports %}
  45. {%- for v in service.source_ports.tcp %}
  46. <source-port port="{{ v }}" protocol="tcp" />
  47. {%- endfor %}
  48. {%- endif %}
  49. {%- if 'udp' in service.source_ports %}
  50. {%- for v in service.source_ports.udp %}
  51. <source-port port="{{ v }}" protocol="udp" />
  52. {%- endfor %}
  53. {%- endif %}
  54. {%- if 'sctp' in service.source_ports %}
  55. {%- for v in service.source_ports.sctp %}
  56. <source-port port="{{ v }}" protocol="sctp" />
  57. {%- endfor %}
  58. {%- endif %}
  59. {%- if 'dccp' in service.source_ports %}
  60. {%- for v in service.source_ports.dccp %}
  61. <source-port port="{{ v }}" protocol="dccp" />
  62. {%- endfor %}
  63. {%- endif %}
  64. {%- endif %}
  65. {%- if 'modules' in service %}
  66. {%- for v in service.modules %}
  67. <module name="{{ v }}" />
  68. {%- endfor %}
  69. {%- endif %}
  70. {%- if 'destinations' in service %}
  71. {%- if 'ipv4' in service.destinations %}
  72. {%- for v in service.destinations.ipv4 %}
  73. <destination ipv4="{{ v }}" />
  74. {%- endfor %}
  75. {%- endif %}
  76. {%- if 'ipv6' in service.destinations %}
  77. {%- for v in service.destinations.ipv6 %}
  78. <destination ipv6="{{ v }}" />
  79. {%- endfor %}
  80. {%- endif %}
  81. {%- endif %}
  82. </service>