Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. - name: asdf
  2. hosts: localhost
  3. tasks:
  4. - name: Set fact to empty
  5. set_fact:
  6. directories: ''
  7.  
  8. - name: Store a directory listing with file globbing
  9. find:
  10. paths: ./test_dir/
  11. file_type: directory
  12. recurse: no
  13. register: directories_tmp
  14.  
  15. - name: something
  16. set_fact:
  17. directories: "{{ directories_tmp.files | map(attribute='path') | map('basename') | list }}"
  18.  
  19. - name: List directories
  20. debug:
  21. msg: "{{ directories }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement