use of com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties in project cloudbreak by hortonworks.
the class ClusterHostServiceRunner method saveDatalakeNameservers.
/**
* In order to be able to connect an ephemeral cluster to a datalake, the ephemeral cluster needs to know some of the datalake nameservers to resolve
* the custom hostnames.
*/
private void saveDatalakeNameservers(Stack stack, Map<String, SaltPillarProperties> servicePillar) {
Long datalakeId = stack.getDatalakeId();
if (datalakeId != null) {
Stack dataLakeStack = stackRepository.findOneWithLists(datalakeId);
String datalakeDomain = dataLakeStack.getGatewayInstanceMetadata().get(0).getDomain();
List<String> ipList = dataLakeStack.getGatewayInstanceMetadata().stream().map(InstanceMetaData::getPrivateIp).collect(Collectors.toList());
servicePillar.put("forwarder-zones", new SaltPillarProperties("/unbound/forwarders.sls", singletonMap("forwarder-zones", singletonMap(datalakeDomain, singletonMap("nameservers", ipList)))));
}
}
use of com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties in project cloudbreak by hortonworks.
the class ClusterHostServiceRunner method decoratePillarWithAmbariDatabase.
private void decoratePillarWithAmbariDatabase(Cluster cluster, Map<String, SaltPillarProperties> servicePillar) throws CloudbreakOrchestratorFailedException {
RDSConfig ambariRdsConfig = rdsConfigService.findByClusterIdAndType(cluster.getOwner(), cluster.getAccount(), cluster.getId(), RdsType.AMBARI);
if (ambariRdsConfig == null) {
throw new CloudbreakOrchestratorFailedException("Ambari RDSConfig is missing for stack");
}
RdsView ambariRdsView = new RdsView(ambariRdsConfig);
servicePillar.put("ambari-database", new SaltPillarProperties("/ambari/database.sls", singletonMap("ambari", singletonMap("database", ambariRdsView))));
}
use of com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties in project cloudbreak by hortonworks.
the class ClusterHostServiceRunner method saveDockerPillar.
private void saveDockerPillar(ExecutorType executorType, Map<String, SaltPillarProperties> servicePillar) {
Map<String, Object> dockerMap = new HashMap<>();
dockerMap.put("enableContainerExecutor", ExecutorType.CONTAINER.equals(executorType));
servicePillar.put("docker", new SaltPillarProperties("/docker/init.sls", singletonMap("docker", dockerMap)));
}
use of com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties in project cloudbreak by hortonworks.
the class ClusterHostServiceRunner method saveGatewayPillar.
private void saveGatewayPillar(GatewayConfig gatewayConfig, Cluster cluster, Map<String, SaltPillarProperties> servicePillar) throws IOException {
Map<String, Object> gateway = new HashMap<>();
gateway.put("address", gatewayConfig.getPublicAddress());
gateway.put("username", cluster.getUserName());
gateway.put("password", cluster.getPassword());
gateway.put("path", cluster.getGateway().getPath());
gateway.put("topology", cluster.getGateway().getTopologyName());
gateway.put("ssotype", cluster.getGateway().getSsoType());
gateway.put("ssoprovider", cluster.getGateway().getSsoProvider());
gateway.put("signpub", cluster.getGateway().getSignPub());
gateway.put("signcert", cluster.getGateway().getSignCert());
gateway.put("signkey", cluster.getGateway().getSignKey());
gateway.put("tokencert", cluster.getGateway().getTokenCert());
gateway.put("mastersecret", cluster.getStack().getSecurityConfig().getKnoxMasterSecret());
gateway.put("kerberos", cluster.isSecure());
Json exposedJson = cluster.getGateway().getExposedServices();
if (exposedJson != null && StringUtils.isNoneEmpty(exposedJson.getValue())) {
List<String> exposedServices = exposedJson.get(ExposedServices.class).getServices();
if (blueprintProcessorFactory.get(cluster.getBlueprint().getBlueprintText()).componentExistsInBlueprint("HIVE_SERVER_INTERACTIVE")) {
exposedServices = exposedServices.stream().map(x -> "HIVE".equals(x) ? "HIVE_INTERACTIVE" : x).collect(Collectors.toList());
}
gateway.put("exposed", exposedServices);
} else {
gateway.put("exposed", new ArrayList<>());
}
Map<String, List<String>> serviceLocation = componentLocator.getComponentLocation(cluster, new HashSet<>(ExposedService.getAllServiceName()));
gateway.put("location", serviceLocation);
servicePillar.put("gateway", new SaltPillarProperties("/gateway/init.sls", singletonMap("gateway", gateway)));
}
use of com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties in project cloudbreak by hortonworks.
the class ProxyConfigProvider method decoratePillarWithProxyDataIfNeeded.
@Transactional
public void decoratePillarWithProxyDataIfNeeded(Map<String, SaltPillarProperties> servicePillar, Cluster cluster) {
ProxyConfig proxyConfig = cluster.getProxyConfig();
if (proxyConfig != null) {
Map<String, Object> proxy = new HashMap<>();
proxy.put("host", proxyConfig.getServerHost());
proxy.put("port", proxyConfig.getServerPort());
proxy.put("protocol", proxyConfig.getProtocol());
if (StringUtils.isNotBlank(proxyConfig.getUserName()) && StringUtils.isNotBlank(proxyConfig.getPassword())) {
proxy.put("user", proxyConfig.getUserName());
proxy.put("password", proxyConfig.getPassword());
}
servicePillar.put(PROXY_KEY, new SaltPillarProperties(PROXY_SLS_PATH, singletonMap(PROXY_KEY, proxy)));
}
}
Aggregations