Skip to content

Instantly share code, notes, and snippets.

@cognifloyd
Last active November 21, 2018 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cognifloyd/422ccc65eac6c62f75d2d76729059ae5 to your computer and use it in GitHub Desktop.
Save cognifloyd/422ccc65eac6c62f75d2d76729059ae5 to your computer and use it in GitHub Desktop.
Example of a surprising way to use loop
- name: a loop that surprised me
stat: "{{ item }}"
loop:
- path: /some/file/path
- path: /another/file/path
- name: a loop the way I normally do it (maybe not for stat, but for modules with multiple paramaters)
stat:
path: "{{ item.path }}"
loop:
- path: /some/file/path
- path: /another/file/path
- name: a pattern I often use with something this simple
stat:
path: "{{ item }}"
loop:
- /some/file/path
- /another/file/path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment