Skip to content

Commit

Permalink
fix collectd
Browse files Browse the repository at this point in the history
  • Loading branch information
FFHener committed Oct 25, 2024
1 parent 0b1e244 commit ba885ce
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#jinja2: trim_blocks: "true", lstrip_blocks: "true"

{% set profiles = snmp_devices | default([]) | map(attribute='os') | list | unique %}
{% set profiles = snmp_devices | default([]) | map(attribute='os') | reject('search', 'openwrt') | list | unique %}
{# collect profiles from new way of writing hosts as well and append them #}
{% for host in groups[group_names[0]]%}
{% if hostvars[host]["os"] is defined %}
{% if hostvars[host]["os"] != "openwrt" %}
{% do profiles.append(hostvars[host]["os"]) %}
{% endif %}
{% endfor %}
Expand Down Expand Up @@ -39,7 +39,7 @@ LoadPlugin snmp
{# Add non-openwrt hosts that are defined as hosts as well #}
{# Only works if mgmt-IPs are defined in the standard way #}
{% for host in groups[group_names[0]]%}
{% if hostvars[host]["os"] is defined %}
{% if hostvars[host]["os"] != "openwrt" %}
{# Calculate the IP for this host based on the mgmt assignment #}
{% set mgmt_network = networks | selectattr('role', 'equalto', 'mgmt') | first %}
<Host "{{ host }}">
Expand Down

0 comments on commit ba885ce

Please sign in to comment.