HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/lib/python3.9/site-packages/ansible/modules/__pycache__/tempfile.cpython-39.pyc
a

�)g�
�@s~ddlmZmZmZeZdZdZdZddl	m
Z
ddlmZm
Z
ddlmZddlmZdd	lmZd
d�Zedkrze�d
S)�)�absolute_import�division�print_functiona�
---
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(ansible.builtin.file) module.
  - For Windows targets, use the M(ansible.windows.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: ""
extends_documentation_fragment: action_common_attributes
attributes:
    check_mode:
        support: none
    diff_mode:
        support: none
    platform:
        platforms: posix
seealso:
- module: ansible.builtin.file
- module: ansible.windows.win_tempfile
author:
  - Krzysztof Magosa (@krzysztof-magosa)
a�
- name: Create temporary build directory
  ansible.builtin.tempfile:
    state: directory
    suffix: build

- name: Create temporary file
  ansible.builtin.tempfile:
    state: file
    suffix: temp
  register: tempfile_1

- name: Use the registered var and the file module to remove the temporary file
  ansible.builtin.file:
    path: "{{ tempfile_1.path }}"
    state: absent
  when: tempfile_1.path is defined
zy
path:
  description: Path to created file or directory.
  returned: success
  type: str
  sample: "/tmp/ansible.bMlvdk"
)�close)�mkstemp�mkdtemp)�
format_exc)�
AnsibleModule)�	to_nativec
Cs�tttddddgd�tdd�tddd�tdd	d�d
�d�}zn|jddkrxt|jd
|jd|jdd�\}}t|�n t|jd
|jd|jdd�}|jd|d�Wn8ty�}z |jt	|�t
�d�WYd}~n
d}~00dS)N�str�fileZ	directory)�type�default�choices�path)r
zansible.)r
r�)�stater�prefix�suffix)Z
argument_specrrr)rr�dirT)Zchangedr)�msg�	exception)r	�dict�paramsrrrZ	exit_json�	ExceptionZ	fail_jsonr
r)�moduleZhandler�e�r�</usr/lib/python3.9/site-packages/ansible/modules/tempfile.py�main]s0

��	�

�r�__main__N)Z
__future__rrrr
Z
__metaclass__Z
DOCUMENTATIONZEXAMPLESZRETURN�osrZtempfilerr�	tracebackrZansible.module_utils.basicr	Zansible.module_utils._textr
r�__name__rrrr�<module>s/