title: How check if a file exists in ansible windows?
body: <p>I am using Ansible on windows and I have to check whether a file exists in <strong>C:\Temp</strong>.
   If the file Doesn't exist then I have to skip the task. I am trying to use the <strong>win_stat</strong> module and this is what I have which isn't working:</p>
  
  <pre><code>- name: Check that the ABC.txt exists
    win_stat:
      path: 'C:\ABC.txt '      
  
  - name: Create DEF.txt file if ABC.txt exists
    win_file:
      path: 'C:\DEF.txt'
      state: touch
    when: stat_file.stat.exists == True 
  </code></pre>