mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Adding integration tests for async fire-and-forget checking
Also updated the CHANGELOG for the feature
This commit is contained in:
parent
8b7e16e4e3
commit
21dcfd7192
2 changed files with 26 additions and 0 deletions
|
@ -16,6 +16,7 @@ Major changes:
|
||||||
* command_warnings feature will warn about when usage of the shell/command module can be simplified to use core modules - this can be enabled in ansible.cfg
|
* command_warnings feature will warn about when usage of the shell/command module can be simplified to use core modules - this can be enabled in ansible.cfg
|
||||||
* new omit value can be used to leave off a parameter when not set, like so module_name: a=1 b={{ c | default(omit) }}, would not pass value for b (not even an empty value) if c was not set.
|
* new omit value can be used to leave off a parameter when not set, like so module_name: a=1 b={{ c | default(omit) }}, would not pass value for b (not even an empty value) if c was not set.
|
||||||
* developers: 'baby JSON' in module responses, originally intended for writing modules in bash, is removed as a feature to simplify logic, script module remains available for running bash scripts.
|
* developers: 'baby JSON' in module responses, originally intended for writing modules in bash, is removed as a feature to simplify logic, script module remains available for running bash scripts.
|
||||||
|
* async jobs started in "fire & forget" mode can now be checked on at a later time.
|
||||||
|
|
||||||
New Modules:
|
New Modules:
|
||||||
|
|
||||||
|
|
|
@ -62,3 +62,28 @@
|
||||||
async: 15
|
async: 15
|
||||||
poll: 0
|
poll: 0
|
||||||
when: False
|
when: False
|
||||||
|
|
||||||
|
# test async "fire and forget, but check later"
|
||||||
|
|
||||||
|
- name: 'start a task with "fire-and-forget"'
|
||||||
|
command: sleep 15
|
||||||
|
async: 30
|
||||||
|
poll: 0
|
||||||
|
register: fnf_task
|
||||||
|
|
||||||
|
- name: assert task was successfully started
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- fnf_task.started
|
||||||
|
- "'ansible_job_id' in fnf_task"
|
||||||
|
|
||||||
|
- name: 'check on task started as a "fire-and-forget"'
|
||||||
|
async_status: jid={{ fnf_task.ansible_job_id }}
|
||||||
|
register: fnf_result
|
||||||
|
until: fnf_result.finished
|
||||||
|
retries: 30
|
||||||
|
|
||||||
|
- name: assert task was successfully checked
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- fnf_result.finished
|
||||||
|
|
Loading…
Reference in a new issue