<commit_before>#!stateconf
{% from 'states/nagios/map.jinja' import nagios as nagios_map with context %}

.params:
    stateconf.set: []
# --- end of state config ---

{% set server_ips = [] %}
{% for server in params.servers %}
{% do server_ips.append(server.ip) %}
{% endfor %}

{% set port = params.get('port', nagios_map.check_mk.agent.port) %}
check_mk-agent-iptables:
  iptables.append:
    - table: filter
    - chain: ZONE_LOCAL
    - proto: tcp
    - jump: ACCEPT
    - source: {{ server_ips|join(',') }}
    - dports: {{ port }}
    - family: ipv4
    - save: true
    - match: comment
    - comment: check_mk agent
    - require:
      - iptables: chain_zone_local_ipv4
<commit_msg>check_mk agent: Skip iptables roles without servers.<commit_after>#!stateconf
{% from 'states/nagios/map.jinja' import nagios as nagios_map with context %}

.params:
    stateconf.set: []
# --- end of state config ---

{% set server_ips = [] %}
{% for server in params.servers %}
{% do server_ips.append(server.ip) %}
{% endfor %}

{% set port = params.get('port', nagios_map.check_mk.agent.port) %}

{% if server_ips %}
check_mk-agent-iptables:
  iptables.append:
    - table: filter
    - chain: ZONE_LOCAL
    - proto: tcp
    - jump: ACCEPT
    - source: {{ server_ips|join(',') }}
    - dports: {{ port }}
    - family: ipv4
    - save: true
    - match: comment
    - comment: check_mk agent
    - require:
      - iptables: chain_zone_local_ipv4
{% endif %}

{'fraction_non_alphanumeric': 0.1550068587105624, 'fraction_numerical': 0.0027434842249657062, 'mean_word_length': 2.85978835978836, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4209130', 'n_tokens_mistral': 541, 'n_tokens_neox': 519, 'n_words': 117}