Add local_action example in case of multiple arguments (#26427)
* Add local_action example in case of multiple arguments Add an example to show how local_action can be used in case of multiple arguments. * Update playbooks_delegation.rst
This commit is contained in:
parent
341cf290d3
commit
732912b641
1 changed files with 14 additions and 0 deletions
|
@ -160,6 +160,20 @@ Here is an example::
|
|||
Note that you must have passphrase-less SSH keys or an ssh-agent configured for this to work, otherwise rsync
|
||||
will need to ask for a passphrase.
|
||||
|
||||
In case you have to specify more arguments you can use the following syntax::
|
||||
|
||||
---
|
||||
# ...
|
||||
tasks:
|
||||
|
||||
- name: Send summary mail
|
||||
local_action:
|
||||
module: mail
|
||||
subject: "Summary Mail"
|
||||
to: "{{ mail_recipient }}"
|
||||
body: "{{ mail_body }}"
|
||||
run_once: True
|
||||
|
||||
The `ansible_host` variable (`ansible_ssh_host` in 1.x or specific to ssh/paramiko plugins) reflects the host a task is delegated to.
|
||||
|
||||
.. _delegate_facts:
|
||||
|
|
Loading…
Reference in a new issue