Global Arguments

In addition to each operations having its own arguments, there are a number of keyword arguments available in all facts, 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 this user using 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=False
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

Note

Not available in facts.

name
Name of the operation.
_ignore_errors=False
Ignore errors when executing the operation.
_continue_on_error=False
Continue executing operation commands after error. Only applies when _ignore_errors is true.
_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

Note

Not available in facts, value must be the same for all hosts.

_parallel=0
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.