diff --git a/playbooks/organize_home.yml b/playbooks/organize_home.yml index b6b6403..1a3f5be 100644 --- a/playbooks/organize_home.yml +++ b/playbooks/organize_home.yml @@ -81,8 +81,8 @@ - { src: '.myclirc', dest: '.config/mycli/myclirc' } - { src: '.tig_history', dest: '.local/share/tig/history' } - - name: Move file or directory - command: "mv {{ home_dir }}/{{ item.item.src }} {{ home_dir }}/{{ item.item.dest }}" + - name: Move file or directory using shell for idempotency + shell: "cp -aT '{{ home_dir }}/{{ item.item.src }}' '{{ home_dir }}/{{ item.item.dest }}' && rm -rf '{{ home_dir }}/{{ item.item.src }}'" when: item.stat.exists loop: "{{ stat_result.results }}" loop_control: