@Beta
public class SshTasks
extends java.lang.Object
Task
instances to perform SSH activities on an SshMachineLocation
.
To infer the SshMachineLocation
and take properties from entities and global management context the
SshEffectorTasks
should be preferred over this class.
SshEffectorTasks
Modifier and Type | Class and Description |
---|---|
static class |
SshTasks.OnFailingTask |
Constructor and Description |
---|
SshTasks() |
Modifier and Type | Method and Description |
---|---|
static ProcessTaskFactory<java.lang.Boolean> |
dontRequireTtyForSudo(SshMachineLocation machine,
boolean failIfCantSudo) |
static ProcessTaskFactory<java.lang.Boolean> |
dontRequireTtyForSudo(SshMachineLocation machine,
SshTasks.OnFailingTask onFailingTaskRequested)
creates a task which returns modifies sudoers to ensure non-tty access is permitted;
also gives nice warnings if sudo is not permitted
|
static TaskFactory<?> |
installFromUrl(ResourceUtils utils,
java.util.Map<java.lang.String,?> props,
SshMachineLocation location,
java.lang.String url,
java.lang.String destPath)
task to install a file given a url, where the url is resolved remotely first then locally
|
static TaskFactory<?> |
installFromUrl(SshMachineLocation location,
java.lang.String url,
java.lang.String destPath)
task to install a file given a url, where the url is resolved remotely first then locally
|
static ProcessTaskFactory<java.lang.Integer> |
newSshExecTaskFactory(SshMachineLocation machine,
boolean useMachineConfig,
java.lang.String... commands) |
static ProcessTaskFactory<java.lang.Integer> |
newSshExecTaskFactory(SshMachineLocation machine,
java.lang.String... commands) |
static SshFetchTaskFactory |
newSshFetchTaskFactory(SshMachineLocation machine,
boolean useMachineConfig,
java.lang.String remoteFile) |
static SshFetchTaskFactory |
newSshFetchTaskFactory(SshMachineLocation machine,
java.lang.String remoteFile) |
static SshPutTaskFactory |
newSshPutTaskFactory(SshMachineLocation machine,
boolean useMachineConfig,
java.lang.String remoteFile) |
static SshPutTaskFactory |
newSshPutTaskFactory(SshMachineLocation machine,
java.lang.String remoteFile) |
static com.google.common.base.Function<ProcessTaskWrapper<?>,java.lang.String> |
returningStdoutLoggingInfo(org.slf4j.Logger logger,
boolean requireZero)
Function for use in
ProcessTaskFactory.returning(Function) which logs all information, optionally requires zero exit code,
and then returns stdout |
public static ProcessTaskFactory<java.lang.Integer> newSshExecTaskFactory(SshMachineLocation machine, java.lang.String... commands)
public static ProcessTaskFactory<java.lang.Integer> newSshExecTaskFactory(SshMachineLocation machine, boolean useMachineConfig, java.lang.String... commands)
public static SshPutTaskFactory newSshPutTaskFactory(SshMachineLocation machine, java.lang.String remoteFile)
public static SshPutTaskFactory newSshPutTaskFactory(SshMachineLocation machine, boolean useMachineConfig, java.lang.String remoteFile)
public static SshFetchTaskFactory newSshFetchTaskFactory(SshMachineLocation machine, java.lang.String remoteFile)
public static SshFetchTaskFactory newSshFetchTaskFactory(SshMachineLocation machine, boolean useMachineConfig, java.lang.String remoteFile)
public static ProcessTaskFactory<java.lang.Boolean> dontRequireTtyForSudo(SshMachineLocation machine, boolean failIfCantSudo)
public static ProcessTaskFactory<java.lang.Boolean> dontRequireTtyForSudo(SshMachineLocation machine, SshTasks.OnFailingTask onFailingTaskRequested)
public static com.google.common.base.Function<ProcessTaskWrapper<?>,java.lang.String> returningStdoutLoggingInfo(org.slf4j.Logger logger, boolean requireZero)
ProcessTaskFactory.returning(Function)
which logs all information, optionally requires zero exit code,
and then returns stdoutpublic static TaskFactory<?> installFromUrl(SshMachineLocation location, java.lang.String url, java.lang.String destPath)
public static TaskFactory<?> installFromUrl(ResourceUtils utils, java.util.Map<java.lang.String,?> props, SshMachineLocation location, java.lang.String url, java.lang.String destPath)