[Docs] Fix old YAML style in async docs (#31421)
* [Docs] Fix old YAML style in async docs This patch fixes some old-style YAML in the documentation for asynchronous playbooks. * Removed hard-to-localize colloquialismspull/4420/head
parent
1fe608afbf
commit
6957339fce
|
@ -33,7 +33,7 @@ poll value is 10 seconds if you do not specify a value for `poll`::
|
||||||
default.
|
default.
|
||||||
|
|
||||||
Alternatively, if you do not need to wait on the task to complete, you may
|
Alternatively, if you do not need to wait on the task to complete, you may
|
||||||
"fire and forget" by specifying a poll value of 0::
|
run the task asynchronously by specifying a poll value of 0::
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -48,36 +48,38 @@ Alternatively, if you do not need to wait on the task to complete, you may
|
||||||
poll: 0
|
poll: 0
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
You shouldn't "fire and forget" with operations that require
|
You shouldn't attempt run a task asynchronously by specifying a poll value of 0:: to with operations that require
|
||||||
exclusive locks, such as yum transactions, if you expect to run other
|
exclusive locks (such as yum transactions) if you expect to run other
|
||||||
commands later in the playbook against those same resources.
|
commands later in the playbook against those same resources.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
Using a higher value for ``--forks`` will result in kicking off asynchronous
|
Using a higher value for ``--forks`` will result in kicking off asynchronous
|
||||||
tasks even faster. This also increases the efficiency of polling.
|
tasks even faster. This also increases the efficiency of polling.
|
||||||
|
|
||||||
If you would like to perform a variation of the "fire and forget" where you
|
If you would like to perform a task asynchroniusly and check on it later you can perform a task similar to the
|
||||||
"fire and forget, check on it later" you can perform a task similar to the
|
|
||||||
following::
|
following::
|
||||||
|
|
||||||
---
|
---
|
||||||
# Requires ansible 1.8+
|
# Requires ansible 1.8+
|
||||||
- name: 'YUM - fire and forget task'
|
- name: 'YUM - async task'
|
||||||
yum: name=docker-io state=installed
|
yum:
|
||||||
|
name: docker-io
|
||||||
|
state: installed
|
||||||
async: 1000
|
async: 1000
|
||||||
poll: 0
|
poll: 0
|
||||||
register: yum_sleeper
|
register: yum_sleeper
|
||||||
|
|
||||||
- name: 'YUM - check on fire and forget task'
|
- name: 'YUM - check on async task'
|
||||||
async_status: jid={{ yum_sleeper.ansible_job_id }}
|
async_status:
|
||||||
|
jid: "{{ yum_sleeper.ansible_job_id }}"
|
||||||
register: job_result
|
register: job_result
|
||||||
until: job_result.finished
|
until: job_result.finished
|
||||||
retries: 30
|
retries: 30
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
If the value of ``async:`` is not high enough, this will cause the
|
If the value of ``async:`` is not high enough, this will cause the
|
||||||
"check on it later" task to fail because the temporary status file that
|
"check on it later" task to fail because the temporary status file that
|
||||||
the ``async_status:`` is looking for will not have been written or no longer exist
|
the ``async_status:`` is looking for will not have been written or no longer exist
|
||||||
|
|
||||||
If you would like to run multiple asynchronous tasks while limiting the amount
|
If you would like to run multiple asynchronous tasks while limiting the amount
|
||||||
of tasks running concurrently, you can do it this way::
|
of tasks running concurrently, you can do it this way::
|
||||||
|
|
Loading…
Reference in New Issue