last modified files only moved ansible? -
my requirement moving files remote host using ansible playbook.
my ansible script
--- - hosts: webservers remote_user: root tasks: - copy: src=/home/bu/bilal/site dest=/tmp owner=root group=root mode=777
when run playbook has moved file remote.
when have ran playbook again overwrite whole folder again. looking, files have modified files overwrite because folder size large taking time single file change.
take @ synchronize module:
uses rsync make synchronizing file paths in playbooks quick , easy.
example:
- name: sync files synchronize: src: "{{ conf.dev_path }}/" dest: "{{ conf.host_path }}" delete: yes rsync_opts: - "--exclude=.*"
Comments
Post a Comment