Question:
I’m trying to use the result of Ansible find command, which return list of files it find on a specific folder, the problem is, when I iterate over the result, I do not have the file names, I only have their full paths (including the name), is there an easy way to use the result item below to provide the file_name in the second command as shown below?
1 2 3 4 5 6 7 8 9 10 11 |
- name: get files find: paths: /home/me file_type: "file" register: find_result - name: Execute docker secret create shell: docker secret create run_once: true with_items: "{{ find_result.files }}" |