From: Oleg Broytman Date: Fri, 26 Jul 2019 15:43:23 +0000 (+0300) Subject: Feat(update-root): Use module `synchronize` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=86211525a9c231f5562c9b08f25a5d2c3b2838f0;p=ansible.git Feat(update-root): Use module `synchronize` Use `synchronize:` delegated to the remote host instead of running `rsync` directly with `command:`. --- 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"