Veronique Lefebure writes: > 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) " ] },
=> client-classes takes a list of class names, not an expression. We need to create a new class e.g. Desktop using the test part as its expression (i.e. substring(option[vendor-class-identifier].text, 0, 9) == 'PXEClient'. The expression grammar can return a boolean or a string so what you can do with an ifelse can be done with a class. Regards Francis Dupont <fdup...@isc.org> _______________________________________________ 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