ansible/ansible — pull request #4627 by sergevanginderachter (2013-10-21 22:30:47+00:00)
Title: Implement nesting lookup plugins

As proposed at #4060

This should allow to implement everything and more
than currently is possible in the not documented, not supported,
soon to be deprecated include: + with_items: construct

- debug: msg="{{item}}"
with_flattened:
- lookup('first_found', ['/etc/network/interfaces', '/etc/sysconfig/network'])
- lookup('fileglob', '/boot/*')
- lookup('file', '/etc/hostname')
- lookup('lines', 'ls /boot/grub/')
- lookup('pipe', 'hostname --fqdn')
- lookup('sequence', 'start=5 end=10 stride=5')

A test playbook and it's output can be found at https://gist.github.com/sergevanginderachter/7092035