use of com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker.StateRunner in project cloudbreak by hortonworks.
the class SaltTelemetryOrchestrator method runSimpleSaltState.
private void runSimpleSaltState(List<GatewayConfig> allGateways, Set<Node> nodes, ExitCriteriaModel exitModel, String saltState, String errorMessage, int retryCount, boolean retryOnFail) throws CloudbreakOrchestratorFailedException {
GatewayConfig primaryGateway = saltService.getPrimaryGatewayConfig(allGateways);
Set<String> targetHostnames = nodes.stream().map(Node::getHostname).collect(Collectors.toSet());
try (SaltConnector sc = saltService.createSaltConnector(primaryGateway)) {
StateRunner stateRunner = new StateRunner(targetHostnames, nodes, saltState);
OrchestratorBootstrap saltJobIdTracker = new SaltJobIdTracker(sc, stateRunner, retryOnFail);
Callable<Boolean> saltJobRunBootstrapRunner = saltRunner.runner(saltJobIdTracker, exitCriteria, exitModel, retryCount, false);
saltJobRunBootstrapRunner.call();
} catch (Exception e) {
LOGGER.debug(errorMessage, e);
throw new CloudbreakOrchestratorFailedException(e);
}
}
Aggregations