summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSloane Hertel <19572925+s-hertel@users.noreply.github.com>2023-09-14 21:11:28 +0200
committerGitHub <noreply@github.com>2023-09-14 21:11:28 +0200
commit81c83c623cb78ca32d1a6ab7ff8a3e67bd62cc54 (patch)
treefb2c01cb06896b45a509acc559f691d13db134c8
parentgalaxy: check if the target for symlink exists (#81586) (diff)
downloadansible-81c83c623cb78ca32d1a6ab7ff8a3e67bd62cc54.tar.xz
ansible-81c83c623cb78ca32d1a6ab7ff8a3e67bd62cc54.zip
Add an example for cleaning up the async job cache, and clarify how that works (#81697)
-rw-r--r--lib/ansible/modules/async_status.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ansible/modules/async_status.py b/lib/ansible/modules/async_status.py
index e0a5871bcd..c54ce3c624 100644
--- a/lib/ansible/modules/async_status.py
+++ b/lib/ansible/modules/async_status.py
@@ -24,7 +24,7 @@ options:
mode:
description:
- If V(status), obtain the status.
- - If V(cleanup), clean up the async job cache (by default in C(~/.ansible_async/)) for the specified job O(jid).
+ - If V(cleanup), clean up the async job cache (by default in C(~/.ansible_async/)) for the specified job O(jid), without waiting for it to finish.
type: str
choices: [ cleanup, status ]
default: status
@@ -70,6 +70,11 @@ EXAMPLES = r'''
until: job_result.finished
retries: 100
delay: 10
+
+- name: Clean up async file
+ ansible.builtin.async_status:
+ jid: '{{ yum_sleeper.ansible_job_id }}'
+ mode: cleanup
'''
RETURN = r'''