Skip to content

Instantly share code, notes, and snippets.

@RunsFor
Last active April 14, 2020 16:29
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 RunsFor/b0cebd29c91b7c1248cae70f6dcf0adc to your computer and use it in GitHub Desktop.
Save RunsFor/b0cebd29c91b7c1248cae70f6dcf0adc to your computer and use it in GitHub Desktop.
fileglob lookup plugin does not search playbook dir
19:16:12 level2 [master] tree
├── file.txt
├── files
│   └── file.txt
├── hosts.yml
├── main.yml
└── roles
└── lookup
└── tasks
└── main.yml
4 directories, 5 files
19:17:28 level2 [master] cat file.txt files/file.txt
Root file
files/ file
19:20:06 level2 [master] cat main.yml
---
- hosts: core
tasks:
- name: Import role lookup
import_role:
name: lookup
vars:
path: "{{ lookup('fileglob', '*.txt', ansible_search_path=vars.playbook_dir) }}"
19:20:09 level2 [master] cat roles/lookup/tasks/main.yml
---
- debug:
var: path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment