diff --git a/lib/ansible/modules/tempfile.py b/lib/ansible/modules/tempfile.py index bf0c5077f97..03176a4612c 100644 --- a/lib/ansible/modules/tempfile.py +++ b/lib/ansible/modules/tempfile.py @@ -67,6 +67,12 @@ EXAMPLES = """ suffix: temp register: tempfile_1 +- name: Create a temporary file with a specific prefix + ansible.builtin.tempfile: + state: file + suffix: txt + prefix: myfile_ + - name: Use the registered var and the file module to remove the temporary file ansible.builtin.file: path: "{{ tempfile_1.path }}"