From 86211525a9c231f5562c9b08f25a5d2c3b2838f0 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 26 Jul 2019 18:43:23 +0300 Subject: [PATCH] Feat(update-root): Use module `synchronize` Use `synchronize:` delegated to the remote host instead of running `rsync` directly with `command:`. --- playbooks/debian/update-root.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/playbooks/debian/update-root.yml b/playbooks/debian/update-root.yml index b2ef0ec..1deda04 100644 --- a/playbooks/debian/update-root.yml +++ b/playbooks/debian/update-root.yml @@ -4,9 +4,14 @@ gather_facts: false tasks: - name: "Update ~root - sync directories from ~phd" - command: "rsync -rlt --info=name ~phd/{{ item }} ~root" - register: rsync - changed_when: rsync.stdout != '' + synchronize: + src: "~phd/{{ item }}" + dest: ~root + archive: no # avoid setting owner/group + recursive: yes + links: yes + times: yes + delegate_to: "{{ inventory_hostname }}" loop: ['.vim', 'bin', 'lib'] - name: "Update ~root - sync files from ~phd" -- 2.39.5