%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.9/site-packages/ansible/modules/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.9/site-packages/ansible/modules/__pycache__/async_status.cpython-39.opt-1.pyc

a

�)g(�@srddlmZmZmZeZdZdZdZddl	Z	ddl
Z
ddlmZddl
mZddlmZd	d
�Zedkrne�dS)�)�absolute_import�division�print_functiona=
---
module: async_status
short_description: Obtain status of asynchronous task
description:
- This module gets the status of an asynchronous task.
- This module is also supported for Windows targets.
version_added: "0.5"
options:
  jid:
    description:
    - Job or task identifier
    type: str
    required: true
  mode:
    description:
    - If C(status), obtain the status.
    - If C(cleanup), clean up the async job cache (by default in C(~/.ansible_async/)) for the specified job I(jid).
    type: str
    choices: [ cleanup, status ]
    default: status
extends_documentation_fragment:
- action_common_attributes
- action_common_attributes.flow
attributes:
    action:
        support: full
    async:
        support: none
    check_mode:
        support: none
    diff_mode:
        support: none
    bypass_host_loop:
        support: none
    platform:
        support: full
        platforms: posix, windows
seealso:
- ref: playbooks_async
  description: Detailed information on how to use asynchronous actions and polling.
author:
- Ansible Core Team
- Michael DeHaan
aV
---
- name: Asynchronous yum task
  ansible.builtin.yum:
    name: docker-io
    state: present
  async: 1000
  poll: 0
  register: yum_sleeper

- name: Wait for asynchronous job to end
  ansible.builtin.async_status:
    jid: '{{ yum_sleeper.ansible_job_id }}'
  register: job_result
  until: job_result.finished
  retries: 100
  delay: 10
a�
ansible_job_id:
  description: The asynchronous job id
  returned: success
  type: str
  sample: '360874038559.4169'
finished:
  description: Whether the asynchronous job has finished (C(1)) or not (C(0))
  returned: always
  type: int
  sample: 1
started:
  description: Whether the asynchronous job has started (C(1)) or not (C(0))
  returned: always
  type: int
  sample: 1
stdout:
  description: Any output returned by async_wrapper
  returned: always
  type: str
stderr:
  description: Any errors returned by async_wrapper
  returned: always
  type: str
erased:
  description: Path to erased job file
  returned: when file is erased
  type: str
N)�
AnsibleModule)�	iteritems��	to_nativec
Cs�tttddd�tddddgd�tddd�d�d	�}|jd
}|jd}|jd}tj�|�}tj�||�}tj�|�s�|jd
|ddd�|dkr�t�	|�|j
||d�d}z:t|��}t�
|���}Wd�n1s�0YWnFt�y,|�s|j
||ddd�n|j||d|ddd�Yn0d|v�rJd|d<||d<nd|v�r\d|d<dd�t|�D�}|j
fi|��dS)N�strT)�type�required�statusZcleanup)r
�default�choices�path)�jid�mode�
_async_dir)Z
argument_specrrrzcould not find job�)�msg�ansible_job_id�started�finished)rZerasedr)�results_filerrrzCould not parse job output: %s)rrrrrrrrcSsi|]\}}t|�|�qS�r)�.0�k�vrr�@/usr/lib/python3.9/site-packages/ansible/modules/async_status.py�
<dictcomp>��zmain.<locals>.<dictcomp>)r�dict�params�osr�
expanduser�join�existsZ	fail_json�unlinkZ	exit_json�open�json�loads�read�	Exceptionr)�modulerrZ	async_dirZlogdirZlog_path�data�frrr�mainqs@

�





0
�


r/�__main__)Z
__future__rrrr
Z
__metaclass__Z
DOCUMENTATIONZEXAMPLESZRETURNr(r"Zansible.module_utils.basicrZansible.module_utils.sixrZansible.module_utils._textrr/�__name__rrrr�<module>s.4

Zerion Mini Shell 1.0