Skip to content

Instantly share code, notes, and snippets.

@maxim
Last active June 15, 2016 03:41
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save maxim/7dd6e4d98d8c7d1f4961 to your computer and use it in GitHub Desktop.
Save maxim/7dd6e4d98d8c7d1f4961 to your computer and use it in GitHub Desktop.
Copy file on remote machine in ansible
- name: ensure file exists at path
shell: rsync -ci /source/path /destination/path
register: rsync_result
changed_when: "rsync_result.stdout != ''"
@renard
Copy link

renard commented Jul 9, 2014

changed_when: 'rsync_result.stdout != ""'

Avoid unneeded backslashes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment