Parcourir la source

feat(zone.xml): allow more services definition inside zone

Now multiple sections ending with `services` can be defined for each in pillar
and all of them will get merged into one service block in the zone. The goal is
to keep backward compatibility while allowing different services to be defined
in different pillars. So basically have various parts of the pillar affecting
the firewall without need to define everything centrally. Helpful for the
exceptions to the rules.
tags/v0.9.0
Michal Hrusecky il y a 4 ans
Parent
révision
8d0172f5c7
Aucun compte lié à l'adresse e-mail de l'auteur
2 fichiers modifiés avec 9 ajouts et 5 suppressions
  1. +6
    -4
      firewalld/files/zone.xml
  2. +3
    -1
      pillar.example

+ 6
- 4
firewalld/files/zone.xml Voir le fichier

@@ -33,11 +33,13 @@
{%- endif %}
{%- endfor %}
{%- endif %}
{%- if 'services' in zone %}
{%- for v in zone.services %}
{%- for k,val in zone.items() %}
{%- if k.endswith("services") %}
{%- for v in val %}
<service name="{{ v }}" />
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- if 'ports' in zone %}
{%- for v in zone.ports %}
{%- if 'comment' in v %}

+ 3
- 1
pillar.example Voir le fichier

@@ -107,10 +107,12 @@ firewalld:
are accepted.
services:
- http
- zabbixcustom
- https
- ssh
- salt-minion
# Anything in zone definition ending with services will get merged into services
other_services:
- zabbixcustom
protocols:
- igmp
rich_rules:

Chargement…
Annuler
Enregistrer