you could just use stat module to check the file remotely (you would
also get hash to compare to local file)

On Fri, Nov 27, 2015 at 1:48 PM, nusenu <nus...@openmailbox.org> wrote:
>> is there an (easy) way to make the copy module [1] fail if the remote
>> file exists and is different from the source file?
>> The goal is to
>> - not override the destination (force=no) and
>> - abort if the file exists and is different from the source.
>>
>> The fetch module [2] has a 'fail_on_missing' parameter. I would need a
>> fail_on_remotefileexists_but_different ;)
>> Currently one is left with
>> - backup=yes
>> or
>> - force=no
>> but both parameter won't help for the specific use-case.
>>
>> Anyone else had this use-case yet and made a workaround?
>
>
> My workaround procedure is [1]:
>
> 1) copy with force=no
> 2) fetch
> 3) compare files locally via shell (sha1sum)
> 4) fail if fingerprints do not match
>
> If there is a less dirty solution let me know ;)
>
>
> [1]
> https://github.com/nusenu/ansible-relayor/commit/b2462b6b8b4ed3b1351ff167c6dd5f7ed3263e7a
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/5658CFB9.6040501%40openmailbox.org.
> For more options, visit https://groups.google.com/d/optout.



-- 
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8nzAc%2Bte6iy4CDhHCvPsKd%2BM9Ma-1JynMwhi%2BAAfnWV7g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to