use of com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams in project cloudbreak by hortonworks.
the class SshKeyService method createSshStateParams.
private OrchestratorStateParams createSshStateParams(Stack stack, String user, KeyPair keyPair, String authKeysComment, String saltState) {
Cluster cluster = stack.getCluster();
Set<Node> nodes = stackUtil.collectReachableNodes(stack);
OrchestratorStateParams stateParams = new OrchestratorStateParams();
stateParams.setState(saltState);
stateParams.setPrimaryGatewayConfig(gatewayConfigService.getGatewayConfig(stack, stack.getPrimaryGatewayInstance(), stack.getCluster().hasGateway()));
stateParams.setTargetHostNames(nodes.stream().map(Node::getHostname).collect(Collectors.toSet()));
stateParams.setAllNodes(nodes);
stateParams.setExitCriteriaModel(ClusterDeletionBasedExitCriteriaModel.clusterDeletionBasedModel(stack.getId(), cluster.getId()));
stateParams.setStateParams(createSshParams(user, keyPair, authKeysComment));
OrchestratorStateRetryParams retryParams = new OrchestratorStateRetryParams();
retryParams.setMaxRetry(SSH_KEY_OPERATION_RETRY_COUNT);
stateParams.setStateRetryParams(retryParams);
return stateParams;
}
use of com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams in project cloudbreak by hortonworks.
the class SshKeyService method removeSshPublicKeyFromHosts.
public void removeSshPublicKeyFromHosts(Stack stack, String user, String authKeysComment) throws Exception {
OrchestratorStateParams stateParams = createSshStateParams(stack, user, null, authKeysComment, REMOVE_SSH_PUBLICKEY_STATE);
hostOrchestrator.runOrchestratorState(stateParams);
}
use of com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams in project cloudbreak by hortonworks.
the class SshKeyService method addSshPublicKeyToHosts.
public void addSshPublicKeyToHosts(Stack stack, String user, KeyPair keyPair, String authKeysComment) throws Exception {
OrchestratorStateParams stateParams = createSshStateParams(stack, user, keyPair, authKeysComment, REMOVE_SSH_PUBLICKEY_STATE);
hostOrchestrator.runOrchestratorState(stateParams);
stateParams.setState(ADD_SSH_PUBLICKEY_STATE);
hostOrchestrator.runOrchestratorState(stateParams);
}
use of com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams in project cloudbreak by hortonworks.
the class UpgradeCcmOrchestratorServiceTest method testDisableMina.
@Test
void testDisableMina() throws CloudbreakOrchestratorException {
underTest.disableMina(STACK_ID);
verify(hostOrchestrator).runOrchestratorState(paramCaptor.capture());
OrchestratorStateParams params = paramCaptor.getValue();
assertThat(params.getState()).isEqualTo("upgradeccm/disable-ccmv1");
assertOtherStateParams(params);
}
use of com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams in project cloudbreak by hortonworks.
the class UpgradeCcmOrchestratorServiceTest method testReconfigureNginx.
@Test
void testReconfigureNginx() throws CloudbreakOrchestratorException {
underTest.reconfigureNginx(STACK_ID);
verify(hostOrchestrator).runOrchestratorState(paramCaptor.capture());
OrchestratorStateParams params = paramCaptor.getValue();
assertThat(params.getState()).isEqualTo("nginx");
assertOtherStateParams(params);
}
Aggregations