From a457d24b97f04150f7ccd20bcc64d61987a52352 Mon Sep 17 00:00:00 2001 From: Nigel Metheringham Date: Wed, 17 Oct 2012 15:31:33 +0100 Subject: [PATCH] Added comment about long lines in playbooks I had trouble finding this information, so though it was worth adding to docs... but am not sure its easy to find for someone specifically to find. At least I think this inclusion matches the tone of document, but maybe this info should go into a FAQ instead/as-well? --- docsite/rst/playbooks.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docsite/rst/playbooks.rst b/docsite/rst/playbooks.rst index 1d9717b5c48..403faac55f1 100644 --- a/docsite/rst/playbooks.rst +++ b/docsite/rst/playbooks.rst @@ -214,6 +214,14 @@ who's successful exit code is not zero, you may wish to do this:: - name: run this command and ignore the result action: shell /usr/bin/somecommand && /bin/true +If the action line is getting too long for comfort you can break it on +a space and indent any continuation lines:: + + tasks: + - name: Copy ansible inventory file to client + action: copy src=/etc/ansible/hosts dest=/etc/ansible/hosts + owner=root group=root mode=0644 + Variables can be used in action lines. Suppose you defined a variable called 'vhost' in the 'vars' section, you could do this::