- set_fact: file: "{{ {}|combine(files_default, item.value|d({}), {'path': item.key} ) }}" - name: "create file/folder (file module, {{ file.path }})" when: - not file.content - not file.template file: path: "{{ file.path }}" group: "{{ file.group }}" owner: "{{ file.owner }}" mode: "{{ file.mode }}" src: "{{ file.src }}" state: "{{ file.state }}" - name: "create file/folder (copy module, {{ file.path }})" when: - file.content or file.src - file.state != 'link' copy: dest: "{{ file.path }}" group: "{{ file.group }}" owner: "{{ file.owner }}" mode: "{{ file.mode }}" content: "{{ file.content }}" src: "{{ file.src }}"