ansible / ansible.builtin / v2.5.6 / module / tempfile Creates temporary files and directories. | "added in version" 2.3 of ansible.builtin" Authors: Krzysztof Magosa preview | supported by communityansible.builtin.tempfile (v2.5.6) — module
pip
Install with pip install ansible==2.5.6
The C(tempfile) module creates temporary files and directories. C(mktemp) command takes different parameters on various systems, this module helps to avoid troubles related to that. Files/directories created by module are accessible only by creator. In case you need to make them world-accessible you need to use M(file) module.
For Windows targets, use the M(win_tempfile) module instead.
- name: create temporary build directory tempfile: state: directory suffix: build
- name: create temporary file tempfile: state: file suffix: temp
path: description: - Location where temporary file or directory should be created. If path is not specified default system temporary directory will be used. state: choices: - directory - file default: file description: - Whether to create file or directory. prefix: default: ansible. description: - Prefix of file/directory name created by module. suffix: default: '' description: - Suffix of file/directory name created by module.
path: description: Path to created file or directory returned: success sample: /tmp/ansible.bMlvdk type: string