Deleting a windows file

I would like to see if there is a similar command in windows to the wait_for module. I’m deleting a file and would like the playbook to not copy over the new file until it’s complete. Perhaps there’s a different Windows module that can do this, but I didn’t see one in the list. Thanks.

Hey Chris

There isn’t one in the main codebase right now but there is a PR that adds the module. You PR is https://github.com/ansible/ansible/pull/26556 and if you do decide to test this out it would be great to share your results on that page. That being said the win_file and win_copy modules should be able to do what you are looking for. Without seeing your playbook and setup I can’t tell but when you delete a file with win_file or copy a file with win_copy it should only exit once the process is complete.

Thanks

Jordan

I can delete the file with win_file. If it doesn’t move on to the next command before finishing then it should be fine. Thanks for the link.