On 26.01.17 12:24 Cev Ing wrote:
> I need to execute a play, which uses file A to generate file B, if B does 
> not exist or if B exists and is older than A.
> 
> How can I compare file dates in the when condition?

Cleanest solution would be to use two stat commands with "register:
file_A" and compare those variables (I guess file_A.stat.mtime might
work).

Johannes

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0e7d674b-0b29-b4e7-213c-9cf9fac44ddc%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to