Creates temporary files and directories
- Creates temporary files and directories.
- For non-Windows targets, please use the :ref:`ansible.builtin.tempfile <ansible.builtin.tempfile_module>` module instead.
.. seealso:: :ref:`ansible.builtin.tempfile_module` The official documentation on the **ansible.builtin.tempfile** module.
- name: Create temporary build directory
ansible.windows.win_tempfile:
state: directory
suffix: build
- name: Create temporary file
ansible.windows.win_tempfile:
state: file
suffix: temp
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
path
string
|
success |
The absolute path to the created file or directory.
Sample:
C:\Users\Administrator\AppData\Local\Temp\ansible.bMlvdk
|
- Dag Wieers (@dagwieers)