Skip to content

Instantly share code, notes, and snippets.

@lanky
Created November 3, 2016 17:14
Show Gist options
  • Select an option

  • Save lanky/4051c98dd5f346c4336f5ddc16e1d4ec to your computer and use it in GitHub Desktop.

Select an option

Save lanky/4051c98dd5f346c4336f5ddc16e1d4ec to your computer and use it in GitHub Desktop.
---
- name: test looped include
hosts: localhost
vars:
pathnames:
- dir1
- dir2
- dir3
tasks:
- include: globit.yml
with_items: "{{ pathnames }}"
loop_control:
loop_var: pathname
############# globit.yml
- name: use a fileglob for something
debug:
msg: "{{ item }} found"
with_fileglob:
- "{{ pathname }}/*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment