Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: asdf
- hosts: localhost
- tasks:
- - name: Set fact to empty
- set_fact:
- directories: ''
- - name: Store a directory listing with file globbing
- find:
- paths: ./test_dir/
- file_type: directory
- recurse: no
- register: directories_tmp
- - name: something
- set_fact:
- directories: "{{ directories_tmp.files | map(attribute='path') | map('basename') | list }}"
- - name: List directories
- debug:
- msg: "{{ directories }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement