2022-08-01 23:49:21 -05:00
|
|
|
---
|
|
|
|
# tasks file for deploy-files
|
2022-08-02 01:34:41 -05:00
|
|
|
- name: Get dot files from git
|
|
|
|
# noqa git-latest
|
|
|
|
ansible.builtin.git:
|
|
|
|
repo: "{{ dots_repo }}"
|
|
|
|
recursive: true
|
|
|
|
dest: "{{ deploy_path }}"
|
2022-08-02 15:12:49 -05:00
|
|
|
update: true
|
2022-08-03 00:00:17 -05:00
|
|
|
force: "{{ force_dots_overwrite | default(false) }}"
|
2022-08-02 01:34:41 -05:00
|
|
|
|
|
|
|
- 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 }}"
|