I have a list of 6 files; if any of them exist already, I need to delete 
it. If none of them exist just keep going.  What I have below is giving me 
errors that 'tmp_files.stat.exists is false'.  Here is what I have:

- name: Check to see if one file exists already
  stat:
    path: "/work/{{ item }}"
  loop:  "{{ possible_file_names }}"
  register: tmp_files

- debug:
    msg: "file exists"
  when: tmp-file.exists

How do I "stop" the loop when a file exists?  And if it doesn't, keep going 
through the loop?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/bb4572c2-68f2-4dcf-beee-4b8bc521fc4bn%40googlegroups.com.

Reply via email to