From 434c421675104a9ce75cc09a6deb1d2f8e99d424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Posp=C3=AD=C5=A1ek?= Date: Thu, 29 Nov 2018 23:24:58 +0100 Subject: [PATCH] improve usage example of tempfile module (#47933) * Show in example how to use file created by tempfile module --- lib/ansible/modules/files/tempfile.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/ansible/modules/files/tempfile.py b/lib/ansible/modules/files/tempfile.py index 7b4789321f0..dec9664e4df 100644 --- a/lib/ansible/modules/files/tempfile.py +++ b/lib/ansible/modules/files/tempfile.py @@ -55,6 +55,13 @@ EXAMPLES = """ tempfile: state: file suffix: temp + register: tempfile_1 + +- name: use the registered var and the file module to remove the temporary file + file: + path: "{{ tempfile_1.path }}" + state: absent + when: tempfile_1.path is defined """ RETURN = '''