You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcpcfg/lib/get_all_cluster_sets

23 lines
611 B

[%
# Return a hash of set_name=>dispatcher_id for a given cluster set type.
#
# @param argv.type The type of element we are interested in (rtp, lb)
# @return out The hash
-%]
[%
out = {};
FOREACH set IN cluster_sets.keys;
NEXT IF (set == 'default_set' || set == 'type');
FOREACH host IN hosts.keys.sort;
NEXT UNLESS hosts.$host.role.grep('^' _ argv.type _ '$').size();
FOREACH iface IN hosts.$host.interfaces;
NEXT UNLESS hosts.$host.$iface.cluster_sets.grep('^' _ set _ '$').size();
out.$set = cluster_sets.$set.dispatcher_id;
END;
END;
END;
-%]