--- # tasks file for deploy-files - name: Get dot files from git # noqa git-latest ansible.builtin.git: repo: "{{ dots_repo }}" recursive: true dest: "{{ deploy_path }}" update: true force: "{{ force_dots_overwrite | default(false) }}" - name: Find all dot files in given paths ansible.builtin.find: paths: "{{ item.paths }}" hidden: true file_type: "{{ item.file_type }}" patterns: - "*" - ".*" register: dot_files_found loop: - file_type: file paths: "{{ dots_path }}/" - file_type: any paths: "{{ dots_path }}/.local/share/" - name: Extract file paths to variable ansible.builtin.set_fact: dot_file_deploys: "{{ item.files + dot_file_deploys }}" loop: "{{ dot_files_found.results }}" - name: Deploy symlinks ansible.builtin.file: state: link src: "{{ item.path }}" path: "{{ ansible_env.HOME }}/{{ item.path | replace(dots_path, '') }}" loop: "{{ dot_file_deploys }}"