Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/utilities/logic/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/utilities/logic/async_status.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlm
Z
dd
lmZddlmZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontstableinterfacetstatustcoretsupported_bys
---
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
notes:
- This module is also supported for Windows targets.
seealso:
- ref: playbooks_async
  description: Detailed information on how to use asynchronous actions and polling.
author:
- Ansible Core Team
- Michael DeHaan
s)
---
- name: Asynchronous yum task
  yum:
    name: docker-io
    state: present
  async: 1000
  poll: 0
  register: yum_sleeper

- name: Wait for asynchronous job to end
  async_status:
    jid: '{{ yum_sleeper.ansible_job_id }}'
  register: job_result
  until: job_result.finished
  retries: 30
s|
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: success
  type: int
  sample: 1
started:
  description: Whether the asynchronous job has started (C(1)) or not (C(0))
  returned: success
  type: int
  sample: 1
N(t
AnsibleModule(t	iteritems(t	to_nativec
C`s7tdtdtdddt�dtddddd	d
dg�dtdddt���}|jd}|jd}|jd}tjj|�}tjj||�}tjj|�s�|j	d
dd|dddd�n|d
krtj
|�|jd|d|�nd}y.t
|��}tj|j��}WdQXWnhtk
r�|s�|jd|d|dddd�q�|j	d|d|d
d|dddd�nXd|kr�d|d<||d<nd|kr�d|d<ntgt|�D]\}}	t|�|	f^q��}|j|�dS(Nt
argument_spectjidttypetstrtrequiredtmodetdefaultRtchoicestcleanupt
_async_dirtpathtmsgscould not find jobtansible_job_idtstarteditfinishedterasedtresults_fileisCould not parse job output: %s(RtdicttTruetparamstosRt
expandusertjointexistst	fail_jsontunlinkt	exit_jsontNonetopentjsontloadstreadt	ExceptionR	R
(
tmoduleRRt	async_dirtlogdirtlog_pathtdatatftktv((sP/usr/lib/python2.7/site-packages/ansible/modules/utilities/logic/async_status.pytmainYs<!


%

%


7t__main__(t
__future__RRRR
t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR(Rtansible.module_utils.basicRtansible.module_utils.sixR	tansible.module_utils._textR
R4t__name__(((sP/usr/lib/python2.7/site-packages/ansible/modules/utilities/logic/async_status.pyt<module>s


	4

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]