private List<RepositoryInfo> getAllServiceRepos() {
    List<RepositoryInfo> repos = new ArrayList<>();
    for (ServiceModule sm: serviceModules.values()) {
      ServiceDirectory sd = sm.getServiceDirectory();
      if (sd instanceof StackServiceDirectory) {
        StackServiceDirectory ssd = (StackServiceDirectory) sd;
        RepositoryXml serviceRepoXml = ssd.getRepoFile();
        if (null != serviceRepoXml) {
          List<RepositoryInfo> serviceRepos = serviceRepoXml.getRepositories();
          for(RepositoryInfo serviceRepo : serviceRepos) {
            serviceRepo.getApplicableServices().add(sm.getId());
          }
          repos.addAll(serviceRepos);
          if (null != serviceRepoXml.getLatestURI()) {
            registerRepoUpdateTask(serviceRepoXml);
          }
        }
      }
    }
    return repos;
  }
Returns all service repositories for a given stack
@return a list of service repo definitions
ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java