From dbddabce9e568315f5f1d44dd52d00966ed87dbb Mon Sep 17 00:00:00 2001 From: Aditya Putta Date: Wed, 15 Nov 2023 12:43:10 -0600 Subject: [PATCH] Create prefix of file using ansible.builtin.tempfile (#82209) Co-authored-by: Abhijeet Kasurde --- lib/ansible/modules/tempfile.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 }}"