Global Arguments

In addition to each operations having its own arguments, there are a number of keyword arguments available in all operations and deploys.

Note

With the exception of name these are prefixed with _ to avoid clashes with other operation and deploy arguments.

Privilege & user escalation

  • _sudo=False: Execute/apply any changes with sudo.
  • _sudo_user: Execute/apply any changes with sudo as a non-root user.
  • _use_sudo_login=False: Execute sudo with a login shell.
  • _use_sudo_password=False: Whether to use a password with sudo (will ask).
  • _preserve_sudo_env=False: Preserve the shell environment when using sudo.
  • _su_user: Execute/apply any changes with su.
  • _use_su_login=False: Execute su with a login shell.
  • _preserve_su_env=False: Preserve the shell environment when using su.
  • _su_shell: Use this shell (instead of user login shell) when using su). Only available under Linux, for use when using su with a user that has nologin/similar as their login shell.
  • _doas: Execute/apply any changes with doas.
  • _doas_user: Execute/apply any changes with doas as a non-root user.

Shell control & features

  • _shell_executable=sh: The shell to use. Defaults to sh (Unix) or cmd (Windows).
  • _chdir: Directory to switch to before executing the command.
  • _env: Dictionary of environment variables to set.
  • _success_exit_codes=[0]: List of exit codes to consider a success.
  • _timeout: Timeout for each command executed during the operation.
  • _get_pty: Whether to get a pseudoTTY when executing any commands.
  • _stdin: String or buffer to send to the stdin of any commands.

Operation meta & callbacks (not available in facts)

  • name: Name of the operation.
  • _ignore_errors=False: Ignore errors when executing the operation.
  • _precondition: Command to execute & check before the operation commands begin.
  • _postcondition: Command to execute & check after the operation commands complete.
  • _on_success: Callback function to execute on success.
  • _on_error: Callback function to execute on error.

Execution strategy (not available in facts, must be the same for all hosts)

  • _parallel: Run this operation in batches of hosts.
  • _run_once=False: Only execute this operation once, on the first host to see it.
  • _serial=False: Run this operation host by host, rather than in parallel.