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:
jokurz 2017-07-26 04:06:59 +02:00 committed by scottb
parent 341cf290d3
commit 732912b641

View file

@ -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: