1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[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 colloquialisms
This commit is contained in:
Major Hayden 2017-11-13 20:32:37 -06:00 committed by scottb
parent 1fe608afbf
commit 6957339fce

View file

@ -33,7 +33,7 @@ poll value is 10 seconds if you do not specify a value for `poll`::
default.
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
.. note::
You shouldn't "fire and forget" with operations that require
exclusive locks, such as yum transactions, if you expect to run other
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
commands later in the playbook against those same resources.
.. note::
Using a higher value for ``--forks`` will result in kicking off asynchronous
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
"fire and forget, check on it later" you can perform a task similar to the
If you would like to perform a task asynchroniusly and check on it later you can perform a task similar to the
following::
---
---
# Requires ansible 1.8+
- name: 'YUM - fire and forget task'
yum: name=docker-io state=installed
- name: 'YUM - async task'
yum:
name: docker-io
state: installed
async: 1000
poll: 0
register: yum_sleeper
- name: 'YUM - check on fire and forget task'
async_status: jid={{ yum_sleeper.ansible_job_id }}
- name: 'YUM - check on async task'
async_status:
jid: "{{ yum_sleeper.ansible_job_id }}"
register: job_result
until: job_result.finished
retries: 30
.. 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
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
of tasks running concurrently, you can do it this way::