Skip to content

Commit

Permalink
Merge pull request #285 from thenets/add-file_finder
Browse files Browse the repository at this point in the history
Add file_finder.yml
  • Loading branch information
thenets authored Mar 3, 2022
2 parents 9482f6f + 82f2156 commit cc8b3dc
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions file_finder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: Find file and send it's content as an artifact
hosts: localhost
connection: local
gather_facts: False
tasks:
- name: Find all files
find:
file_type: file
hidden: True
recurse: True
paths: ..
register: files

- name: Extract file content
set_fact:
file_content: "{{ file_content | default({}) | combine({ item.path: lookup('file', item.path) }) }}"
loop: "{{ files.files }}"
loop_control:
label: "{{ item.path }}"
when: "'/.git/' not in item.path"

- name: Set job stats
set_stats:
data:
files: "{{ file_content }}"

0 comments on commit cc8b3dc

Please sign in to comment.