[%
  # Return an array of Carrier nodes shared names with a given role
  #
  # @param argv.role    The role of the node to process
  #                     One of: proxy, lb, mgmt
  # @return out         The array of shared names:
  #                     [ 'prx01', 'prx02', 'prx05' ]

  out = []
  blktmp.processed_hosts = {};
  FOREACH host IN hosts.keys.sort;
    NEXT IF blktmp.processed_hosts.$host.defined;
    NEXT UNLESS hosts.$host.role.grep('^' _ argv.role _ '$').size();
    peer = hosts.$host.peer;
    blktmp.processed_hosts.$peer = 1;
    matches = host.match('^(\w+[0-9])[ab]$');
    out.push(matches.0);
  END;
  out = out.sort;
-%]
