# test code for the synchronize module # (c) 2014, James Tanner # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . - name: cleanup old files file: path: '{{ output_dir }}' state: absent - name: ensure the target directory exists file: path: '{{ output_dir }}' state: directory - name: synchronize file to new filename synchronize: src: normal_file.txt dest: '{{ output_dir }}/remote_file.txt' register: sync_result - assert: that: - "'changed' in sync_result" - "sync_result.changed == true" - "'cmd' in sync_result" - "'rsync' in sync_result.cmd" - "'msg' in sync_result" - "sync_result.msg.startswith('