Hi,

Im trying to rename the file using win_command if the file exists using *when 
condition, *other wise it won't execute the command, but it is failing, Can 
any one suggest.

- name: Rename the file based on condition
  win_command: cmd.exe /c rename D:\\{{item,name}}-filename.json  
{{item.name}}.filename.json-{{ ansible_date_time.date}}
  when: {{item.name}}-filename.json,stat.exists
  loop: {{ variable}}


Thank you,



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/efd1986e-db5c-4fe3-8772-751c6ee27d79o%40googlegroups.com.

Reply via email to