All,

Probably a crummy subject line, but here's what I'm trying to do:  I want 
my debug message to return "file exists" or file doesn't exist.  Here's my 
playbook, so far:

---

- hosts: all
  gather_facts: false

  vars:
    file: lmcfg.txt

  tasks:

    - name: gather information
      win_stat:
        path: E:\LM\{{ file}}
      register: file_info

    - name: check if file name exists
      debug: msg='File {{ file }} exists'
      when: file_info.stat.exists == True

I don't know how to add a piece to return "file doesn't exist" if, well, 
the file doesn't exist.  Help much appreciated.

-- 
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/1b17443b-a777-44f7-a1cc-bd673ac2df0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to