I want to get list of name files without full path and without extension name into 2 differents variable, I succeed for the first one, but not on second one.
I have a variable found_files which contains list files on folder
- name: Get only file names
set_fact:
file_names: "{{ found_files['files'] | map(attribute='path') | map('basename') | list }}"
- name: Get name without extension
set_fact:
file_names_without_extension: "{{ item | splitext | first | splitext | first }}" with_list: "{{ file_names }}"
the first task, I get the correct name of files without path, but the second task I get only the first file withtout extension file, and don't succeed to get all file name without extension name.