While copying over templates using the following code
- name: "Template source files to temp directory"
template:
src: '{{ item.src }}'
dest: '{{ temp_file_path.path }}/{{ item.path }}'
force: yes
with_filetree: "{{ nginx_path }}/"
delegate_to: 127.0.0.1
when: item.state == 'file'
I got hit by the error in the title. I got a possible solution from here but the problem here is that one needs to know the names of all the sub directories. This isn’t possible when you runs into tens of them.
What’s the right way to solve this. Something similar to what rysnc does with the - -relative option