pub struct TaskOptions {Show 40 fields
pub action: OptU<String>,
pub any_errors_fatal: OptU<BoolOrString>,
pub args: OptU<IndexMap<String, Value>>,
pub async_: OptU<IntOrString>,
pub become_: OptU<BoolOrString>,
pub become_exe: OptU<String>,
pub become_flags: OptU<String>,
pub become_method: OptU<String>,
pub become_user: OptU<String>,
pub changed_when: OptU<BoolOrStringOrVecString>,
pub check_mode: OptU<BoolOrString>,
pub collections: OptU<Vec<String>>,
pub connection: OptU<String>,
pub debugger: OptU<BoolOrString>,
pub delay: OptU<IntOrString>,
pub delegate_facts: OptU<BoolOrString>,
pub delegate_to: OptU<String>,
pub diff: OptU<BoolOrString>,
pub environment: OptU<IndexMap<String, String>>,
pub failed_when: OptU<BoolOrStringOrVecString>,
pub ignore_errors: OptU<BoolOrString>,
pub ignore_unreachable: OptU<BoolOrString>,
pub local_action: OptU<String>,
pub loop_: OptU<StringOrVec>,
pub loop_control: OptU<IndexMap<String, Value>>,
pub module_defaults: OptU<IndexMap<String, Value>>,
pub no_log: OptU<BoolOrString>,
pub notify: OptU<Vec<String>>,
pub poll: OptU<IntOrString>,
pub port: OptU<IntOrString>,
pub register: OptU<String>,
pub remote_user: OptU<String>,
pub retries: OptU<IntOrString>,
pub run_once: OptU<BoolOrString>,
pub tags: OptU<Vec<String>>,
pub throttle: OptU<IntOrString>,
pub timeout: OptU<IntOrString>,
pub until: OptU<String>,
pub vars: OptU<IndexMap<String, Value>>,
pub when: OptU<BoolOrStringOrVecString>,
}Expand description
Fields§
§action: OptU<String>The ‘action’ to execute for a task, it normally translates into a C(module) or action plugin.
any_errors_fatal: OptU<BoolOrString>Force any un-handled task errors on any host to propagate to all hosts and end the play.
args: OptU<IndexMap<String, Value>>A secondary way to add arguments into a task. Takes a dictionary in which keys map to options and values.
async_: OptU<IntOrString>Run a task asynchronously if the C(action) supports this; the value is the maximum runtime in seconds.
become_: OptU<BoolOrString>Boolean that controls if privilege escalation is used or not on Task execution. Implemented by the become plugin. See Become plugins.
become_exe: OptU<String>Path to the executable used to elevate privileges. Implemented by the become plugin. See Become plugins.
become_flags: OptU<String>A string of flag(s) to pass to the privilege escalation program when become is True.
become_method: OptU<String>Which method of privilege escalation to use (such as sudo or su).
become_user: OptU<String>User that you ‘become’ after using privilege escalation. The remote/login user must have permissions to become this user.
changed_when: OptU<BoolOrStringOrVecString>Conditional expression that overrides the task’s normal ‘changed’ status.
The ansible original type allows Array of strings.
But we use String for now, because all conditions are expressed as a single string.
check_mode: OptU<BoolOrString>A boolean that controls if a task is executed in ‘check’ mode. See Validating tasks: check mode and diff mode.
collections: OptU<Vec<String>>List of collection namespaces to search for modules, plugins, and roles. See Using collections in a playbook
connection: OptU<String>Allows you to change the connection plugin used for tasks to execute on the target. See Using connection plugins.
debugger: OptU<BoolOrString>Enable debugging tasks based on the state of the task result. See Debugging tasks.
delay: OptU<IntOrString>delay Number of seconds to delay between retries. This setting is only used in combination with until.
delegate_facts: OptU<BoolOrString>delegate_facts Boolean that allows you to apply facts to a delegated host instead of inventory_hostname.
delegate_to: OptU<String>Host to execute task instead of the target (inventory_hostname). Connection vars from the delegated host will also be used for the task.
diff: OptU<BoolOrString>Toggle to make tasks return ‘diff’ information or not.
environment: OptU<IndexMap<String, String>>A dictionary that gets converted into environment vars to be provided for the task upon execution. This can ONLY be used with modules. This is not supported for any other type of plugins nor Ansible itself nor its configuration, it just sets the variables for the code responsible for executing the task. This is not a recommended way to pass in confidential data.
failed_when: OptU<BoolOrStringOrVecString>Conditional expression that overrides the task’s normal ‘failed’ status.
ignore_errors: OptU<BoolOrString>Boolean that allows you to ignore task failures and continue with play. It does not affect connection errors.
ignore_unreachable: OptU<BoolOrString>Boolean that allows you to ignore task failures due to an unreachable host and continue with the play. This does not affect other task errors (see ignore_errors) but is useful for groups of volatile/ephemeral hosts.
local_action: OptU<String>Same as action but also implies delegate_to: localhost
loop_: OptU<StringOrVec>Takes a list for the task to iterate over, saving each list element into the item variable (configurable via loop_control)
loop_control: OptU<IndexMap<String, Value>>Several keys here allow you to modify/set loop behavior in a task. See Adding controls to loops.
module_defaults: OptU<IndexMap<String, Value>>Specifies default parameter values for modules.
no_log: OptU<BoolOrString>Boolean that controls information disclosure.
notify: OptU<Vec<String>>List of handlers to notify when the task returns a ‘changed=True’ status.
poll: OptU<IntOrString>Sets the polling interval in seconds for async tasks (default 10s).
port: OptU<IntOrString>Used to override the default port used in a connection.
register: OptU<String>Name of variable that will contain task status and module return data.
remote_user: OptU<String>User used to log into the target via the connection plugin.
retries: OptU<IntOrString>Number of retries before giving up in a until loop. This setting is only used in combination with until.
run_once: OptU<BoolOrString>Boolean that will bypass the host loop, forcing the task to attempt to execute on the first host available and afterward apply any results and facts to all active hosts in the same batch.
Tags applied to the task or included tasks, this allows selecting subsets of tasks from the command line.
throttle: OptU<IntOrString>Limit the number of concurrent task runs on task, block and playbook level. This is independent of the forks and serial settings, but cannot be set higher than those limits. For example, if forks is set to 10 and the throttle is set to 15, at most 10 hosts will be operated on in parallel.
timeout: OptU<IntOrString>Time limit for the task action to execute in, if exceeded, Ansible will interrupt the process. Timeout does not include templating or looping.
until: OptU<String>This keyword implies a ‘retries loop’ that will go on until the condition supplied here is met or we hit the retries limit.
vars: OptU<IndexMap<String, Value>>Dictionary/map of variables
when: OptU<BoolOrStringOrVecString>Conditional expression, determines if an iteration of a task is run or not.
Trait Implementations§
Source§impl Clone for TaskOptions
impl Clone for TaskOptions
Source§fn clone(&self) -> TaskOptions
fn clone(&self) -> TaskOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more