wbbl.conf.tmpl 567 B

123456789101112131415161718192021222324
  1. #
  2. # {{ link_id }}
  3. #
  4. {%- set devices = link_config.get ('devices', {}) %}
  5. {% for device, device_config in devices.items () %}
  6. {%- set fqdn = device ~ '.' ~ link_id %}
  7. {%- set addresses = [] %}
  8. {%- for iface, iface_config in device_config.get ('ifaces', {}).items () %}
  9. {%- for ip in iface_config.get ('prefixes', []) %}
  10. {%- do addresses.append (ip.split ('/')[0]) %}
  11. {%- endfor %}
  12. {%- endfor %}
  13. object Host "{{ fqdn }}" {
  14. import "generic-host"
  15. display_name = "{{ fqdn }}"
  16. address = "{{ addresses[0] }}"
  17. vars.os = "AirOS"
  18. }
  19. {%- endfor %}