|
|
@ -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
|
|
|
|
# show all the hosts in the inventory
|
|
|
|
- debug:
|
|
|
|
- debug:
|
|
|
|
msg: "{{ item }}"
|
|
|
|
msg: "{{ item }}"
|
|
|
|
loop:
|
|
|
|
loop: "{{ groups['all'] }}"
|
|
|
|
- "{{ groups['all'] }}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# show all the hosts in the current play
|
|
|
|
# show all the hosts in the current play
|
|
|
|
- debug:
|
|
|
|
- debug:
|
|
|
|
msg: "{{ item }}"
|
|
|
|
msg: "{{ item }}"
|
|
|
|
loop:
|
|
|
|
loop: "{{ ansible_play_batch }}"
|
|
|
|
- "{{ ansible_play_batch }}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
There is also a specific lookup plugin ``inventory_hostnames`` that can be used like this::
|
|
|
|
There is also a specific lookup plugin ``inventory_hostnames`` that can be used like this::
|
|
|
|
|
|
|
|
|
|
|
|