Hi all, Hope this is the proper place to ask this question... I've written a function such as this (a truncated version here)...
function assign_vlan(ip) { vlan = null if (cidr_match("10.10.0.0/20", ip)) { vlan=110 } else if (cidr_match("10.9.0.0/20", ip)) { vlan=109 } return vlan } I'm then hoping to include the following in my host template (again truncated to just the relevant bits): template Host "vlan-host-template" { vars.net_vlan = {{ assign_vlan(host.address) }} } == The issue I'm having is that I can't figure out how to do this in icinga2web/director. I defined the function manually in conf.d after I couldn't find a way to accomplish that in director and then verified that it works with icinga2 console. I'm trying now to assign a var 'net_vlan' to call the function using director in the host template (such as shown above). Any tips on how to accomplish this in director? These are the versions I have: icingaweb2-2.6.1-1.el7.icinga.noarch icinga2-2.9.1-1.el7.icinga.x86_64 Name: Icinga Director Version: 1.5.1 Thanks! ns
_______________________________________________ icinga-users mailing list icinga-users@lists.icinga.org https://lists.icinga.org/mailman/listinfo/icinga-users