Executors

All executors can be loaded using YAML tags using the (!Tag) syntax. More details are available in the PyYAML documentation.

Alternatively you can also use the legacy COBalD object initialisation syntax to construct executors. But it is discouraged.

Shell Executor

The shell executor is used to execute shell commands asynchronously.

Example configuration

!TardisShellExecutor

Example configuration (COBalD legacy object initialisation)

__type__: tardis.utilities.executors.shellexecutor.ShellExecutor

SSH Executor

The ssh executor is used to asynchronously execute shell commands remotely via ssh. The actual ssh connection to the host is preserved, recycled and automatically reestablished. All parameters specified in the configuration are directly passed as keyword arguments to asyncssh connect call. You can find all available parameters in the asyncssh documentation

Additionally the SSHExecutor supports Multi-factor Authentication (MFA). In order to activate it, you need to add mfa_config as parameter to the SSHExecutor containing a list of command line prompt to TOTP secrets mappings.

Note

The prompt can be obtained by connecting to the server via ssh in a terminal. The prompt is the text the terminal is showing in order to obtain the second factor for the ssh connection. (e.g. “Enter 2FA Token:”)

Example configuration

!TardisSSHExecutor
  host: login.dorie.somewherein.de
  username: clown
  client_keys:
    - /opt/tardis/ssh/tardis

Example configuration (Using Multi-factor Authentication)

!TardisSSHExecutor
  host: login.dorie.somewherein.de
  username: clown
  client_keys:
    - /opt/tardis/ssh/tardis
  mfa_config:
    - prompt: "Enter 2FA Token:"
      totp: "IMIZDDO2I45ZSTR6XDGFSPFDUY"

Example configuration (COBalD legacy object initialisation)

__type__: tardis.utilities.executors.sshexecutor.SSHExecutor
host: login.dorie.somewherein.de
username: clown
client_keys:
  - /opt/tardis/ssh/tardis