Am Donnerstag, 26. Januar 2017 12:34:08 UTC+1 schrieb Johannes Kastl:
>
>
> 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). 
>

Using stat in a local action with become does not seem to work. Shell seems 
to be the only module, which works with become in local actions. This works 
with become:

  shell: |-
    test -e {{ users_pw_hash }} -a {{ users_pw_hash }} -nt /etc/shadow ||
    echo needs_update
  register: etc_shadow_result
  delegate_to: 127.0.0.1
  become: true

-- 
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/35aa104f-c831-4f95-bbcd-5d8fcfd4de51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to