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.