Marko,
Perfect - thanks!
Dimitri
On Friday, February 17, 2017 at 11:35:11 AM UTC-5, Dimitri Yioulos wrote:
>
> 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/f4d7647e-1677-48c2-836c-833821d25319%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.