Lookups are an integral part of loops. Wherever you see ``with_``, the part after the underscore is the name of a lookup. For this reason, most lookups output lists and take lists as input; for example, ``with_items`` uses the :ref:`items <items_lookup>` lookup::
tasks:
- name: count to 3
debug: msg={{item}}
debug: msg={{item}}
with_items: [1, 2, 3]
You can combine lookups with :ref:`filters <playbooks_filters>`, :ref:`tests <playbooks_tests>` and even each other to do some complex data generation and manipulation. For example::
@ -51,8 +51,8 @@ You can combine lookups with :ref:`filters <playbooks_filters>`, :ref:`tests <pl
- name: valid but useless and over complicated chained lookups and filters