<commit_before># Global snmpd configuration for the node.

###############################################################################
# <<<
{% if grains['os'] in [ 'RedHat', 'CentOS', 'Fedora' ] %}

snmp:

{% if pillar['system_features']['allow_package_installation_through_yum']['feature_enabled'] %}

    pkg.installed:
        - pkgs:
            - net-snmp
            - net-snmp-utils
{% endif %}

    service.running:
        - name: snmpd
        - enable: True
{% if pillar['system_features']['allow_package_installation_through_yum']['feature_enabled'] %}
        - require:
            - pkg: snmp
{% endif %}
        - watch:
            - file: /etc/snmp/snmpd.conf

snmpd_conf:
    file.managed:
        - name: /etc/snmp/snmpd.conf
        - source: salt://common/snmp/snmpd.conf
        - user: root
        - group: root
        - mode: 644
        - template: jinja
<commit_msg>Fix `snmp` state to work without internet properly<commit_after># Global snmpd configuration for the node.

###############################################################################
# <<<
{% if grains['os'] in [ 'RedHat', 'CentOS', 'Fedora' ] %}

{% if pillar['system_features']['allow_package_installation_through_yum']['feature_enabled'] %}
install_snmp_packages:
    pkg.installed:
        - pkgs:
            - net-snmp
            - net-snmp-utils
{% endif %}

enable_snmp_service:
    service.running:
        - name: snmpd
        - enable: True
{% if pillar['system_features']['allow_package_installation_through_yum']['feature_enabled'] %}
        - require:
            - pkg: install_snmp_packages
{% endif %}
        - watch:
            - file: /etc/snmp/snmpd.conf

snmpd_conf:
    file.managed:
        - name: /etc/snmp/snmpd.conf
        - source: salt://common/snmp/snmpd.conf
        - user: root
        - group: root
        - mode: 644
        - template: jinja
{% if pillar['system_features']['allow_package_installation_through_yum']['feature_enabled'] %}
        - require:
            - pkg: install_snmp_packages
{% endif %}

{'fraction_non_alphanumeric': 0.206511175898931, 'fraction_numerical': 0.0029154518950437317, 'mean_word_length': 2.568457538994801, 'pattern_counts': {'":': 0, '<': 9, '<?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': '2856476', 'n_tokens_mistral': 680, 'n_tokens_neox': 620, 'n_words': 112}