�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
m Z d d
l m Z d d l m Z d d l m Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys�
---
module: tempfile
version_added: "2.3"
short_description: Creates temporary files and directories
description:
- 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.
options:
state:
description:
- Whether to create file or directory.
type: str
choices: [ directory, file ]
default: file
path:
description:
- Location where temporary file or directory should be created.
- If path is not specified, the default system temporary directory will be used.
type: path
prefix:
description:
- Prefix of file/directory name created by module.
type: str
default: ansible.
suffix:
description:
- Suffix of file/directory name created by module.
type: str
default: ""
seealso:
- module: file
- module: win_tempfile
author:
- Krzysztof Magosa (@krzysztof-magosa)
sp
- name: create temporary build directory
tempfile:
state: directory
suffix: build
- name: create temporary file
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
sx
path:
description: Path to created file or directory
returned: success
type: str
sample: "/tmp/ansible.bMlvdk"
( t close( t mkstempt mkdtemp( t
format_exc( t
AnsibleModule( t to_nativec C` s[ t d t d t d d d d d d d g � d t d d � d
t d d d d � d t d d d d
� � � } y� | j d d k r� t d
| j d
d | j d d | j d � \ } } t | � nF | j d d k rt d
| j d
d | j d d | j d � } n | j d t d | � Wn2 t k
rV} | j d t
| � d t � � n Xd S( Nt
argument_spect statet typet strt defaultt filet choicest directoryt patht prefixs ansible.t suffixt t dirt changedt msgt exception( R t dictt paramsR R R
t exit_jsont Truet Exceptiont fail_jsonR
R ( t modulet handleR t e( ( sB /usr/lib/python2.7/site-packages/ansible/modules/files/tempfile.pyt mainY s* !
t __main__N( t
__future__R R R R t
__metaclass__t ANSIBLE_METADATAt
DOCUMENTATIONt EXAMPLESt RETURNt osR t tempfileR R
t tracebackR t ansible.module_utils.basicR t ansible.module_utils._textR
R'