% for node_data, icingaconf in sorted(bundle_metadata.items()):
%         for service, config in sorted(icingaconf.items()):
object Service "${service}" {
    import "generic-service"
    host_name = "${node_data.name}"
%                 for k, v in sorted(config.items()):
%                         if k not in {'import', 'command_on_monitored_host'} and not k.startswith('vars.notification'):
%                                 if isinstance(v, bool) or isinstance(v, int) or k in ["check_interval", "retry_interval"]:
    ${k} = ${str(v).lower()}
%                                 elif isinstance(v, list):
    ${k} = [${", ".join(['"' + i + '"' for i in v])}]
%                                 else:
    ${k} = "${v}"
%                                 endif
%                         endif
%                 endfor
    vars.bundle = "${bundle_name}"
    vars.notification.sms = ${str(config.get('vars.notification.sms', False)).lower()}
    vars.notification.mail = ${str(config.get('vars.notification.mail', False)).lower()}
}
%         endfor
% endfor
