Probably this has been asked before but can't find anything helpful yet.
I have this task:
- name: Create folder if not exists
win_file:
path: '{{ folder }}'
state: directory
when: my_dir.stat.exists == false << this stat has been previously created
- Debug: msg"folder already exists"
If I execute this the output in Ans. tower looks like this (the folder already exists):
TASK [playbook : Create folder if not exists] ***
17:51:00
23
skipping: [host]
TASK [playbook : debug] ***************************************
18:16:07
26
ok: [host] => {
27
"msg": "Folder already exists"
Ik want this msg to be printed in the Create folder task and not in a separate task.
Help would be appreciated