Improves the Add-Type temporary directory handler to include a retry
mechanism and not fail on an error. Deleting a temporary file used in
compilation is not a critical error and should improve the reliability
of Ansible on Windows hosts.
- name:run module with tempdir with no delete access
win_ping:
register:temp_deletion_warning
vars:
<<:*become_vars
ansible_remote_tmp:C:\Windows\TEMP\test-dir
- name:assert warning about tmpdir deletion is present
assert:
that:
- temp_deletion_warning.warnings | count == 1
- >-
temp_deletion_warning.warnings[0] is
regex("(?i).*Failed to cleanup temporary directory 'C:\\\\Windows\\\\TEMP\\\\test-dir\\\\.*' used for compiling C# code\\. Files may still be present after the task is complete\\..*")