From b2d6cabbce68ab5bb4dc687d33b0898dbc42827d Mon Sep 17 00:00:00 2001 From: Pavel Safronov Date: Thu, 11 Apr 2024 13:42:56 +0100 Subject: [PATCH] Better copy for dotfiles --- roles/user/tasks/configs.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/roles/user/tasks/configs.yml b/roles/user/tasks/configs.yml index 05ed8d5..08eb233 100644 --- a/roles/user/tasks/configs.yml +++ b/roles/user/tasks/configs.yml @@ -1,9 +1,15 @@ - name: config rc files - copy: + synchronize: src: home/ dest: "{{ item.home }}" - follow: no - local_follow: no + rsync_opts: + - "--exclude=.git" + - "--exclude=.gitmodules" + - "--exclude=.gitconfig" + - "--exclude=.gitignore" + - "--chown={{ item.user }}:{{ item.user }}" + - "--update" # skip files that are newer on the receiver + - "--times" # preserve modification times with_items: "{{ users.values() | list }}" - name: config user-dir