From 785e888ea0572d1d3e0d99079751d94214d0fdb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Moser?= Date: Fri, 2 Feb 2018 13:52:28 +0100 Subject: [PATCH] doc: fix loop examples (#34991) --- docs/docsite/rst/playbooks_loops.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/docsite/rst/playbooks_loops.rst b/docs/docsite/rst/playbooks_loops.rst index 9473c91935f..f17a87b6e76 100644 --- a/docs/docsite/rst/playbooks_loops.rst +++ b/docs/docsite/rst/playbooks_loops.rst @@ -195,14 +195,12 @@ One can use a regular ``loop`` with the ``ansible_play_batch`` or ``groups`` var # show all the hosts in the inventory - debug: msg: "{{ item }}" - loop: - - "{{ groups['all'] }}" + loop: "{{ groups['all'] }}" # show all the hosts in the current play - debug: msg: "{{ item }}" - loop: - - "{{ ansible_play_batch }}" + loop: "{{ ansible_play_batch }}" There is also a specific lookup plugin ``inventory_hostnames`` that can be used like this::