From 732912b641002accf623de1833ef0e646f3e7646 Mon Sep 17 00:00:00 2001 From: jokurz Date: Wed, 26 Jul 2017 04:06:59 +0200 Subject: [PATCH] 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 --- docs/docsite/rst/playbooks_delegation.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/docsite/rst/playbooks_delegation.rst b/docs/docsite/rst/playbooks_delegation.rst index ebbac46858..23d2eb2bbe 100644 --- a/docs/docsite/rst/playbooks_delegation.rst +++ b/docs/docsite/rst/playbooks_delegation.rst @@ -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: