Hi,

Is there a way to use ifelse in a host reservation ?

We would like something like

"reservations": [ { "hw-address": "xx:xx:xx:xx:xx:fa", "ip-address": "yy.yy.yy.121", "hostname": "lab-client", "client-classes": [ " ifelse ( substring(option[vendor-class-identifier].text, 0, 9) == 'PXEClient' , 'Desktop', none) " ] },

But the above does not work: KEA interprets the whole string "ifelse ( substring(option[vendor-class-identifier].text, 0, 9) == 'PXEClient' , 'Desktop', none) " as being the client-class name itself.

Alternatively we could use "ifelse" in the client-class definition but none of the combinations we have tried works: we always get a syntax error reported by the validation of the json configuration file.

What we need is the equivalent of what we have in DHCPD:

group { # Desktop Clients if substring (option vendor-class-identifier, 0, 9) = "PXEClient" { option vendor-class-identifier "PXEClient"; option dhcp-server-identifier aims.xxx; next-server aims.xxx; } host client1 { hardware ethernet xx:xx:xx:xx:xx:fa; option host-name "lab-client"; fixed-address yy.yy.yy.121; } ....

}

Thanks,

Veronique

_______________________________________________
ISC funds the development of this software with paid support subscriptions. 
Contact us at https://www.isc.org/contact/ for more information.

To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.

Kea-users mailing list
Kea-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/kea-users

Reply via email to