summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/async
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2024-03-20 16:34:57 +0100
committerGitHub <noreply@github.com>2024-03-20 16:34:57 +0100
commitc9086061ca192e058f991d647ad5e7344dc0747b (patch)
tree807a9a8ed3966cbbc954931dc65168dc15e884f2 /test/integration/targets/async
parentapt: Install recommended packages while installing deb files (#82805) (diff)
downloadansible-c9086061ca192e058f991d647ad5e7344dc0747b.tar.xz
ansible-c9086061ca192e058f991d647ad5e7344dc0747b.zip
Allow check mode async task disabling check_mode (#82827)
* Allow check mode async task disabling check_mode Allows running an async task with check_mode: False when the playbook is being run in check mode. * Add check_mode attribute to internal cleanup task
Diffstat (limited to 'test/integration/targets/async')
-rw-r--r--test/integration/targets/async/check_task_test.yml8
-rw-r--r--test/integration/targets/async/tasks/main.yml12
2 files changed, 20 insertions, 0 deletions
diff --git a/test/integration/targets/async/check_task_test.yml b/test/integration/targets/async/check_task_test.yml
new file mode 100644
index 0000000000..f8756408a1
--- /dev/null
+++ b/test/integration/targets/async/check_task_test.yml
@@ -0,0 +1,8 @@
+- hosts: localhost
+ gather_facts: false
+ tasks:
+ - name: Async in check mode task disabled test
+ command: sleep 5
+ async: 6
+ poll: 1
+ check_mode: False
diff --git a/test/integration/targets/async/tasks/main.yml b/test/integration/targets/async/tasks/main.yml
index f5e5c992e7..491be966a0 100644
--- a/test/integration/targets/async/tasks/main.yml
+++ b/test/integration/targets/async/tasks/main.yml
@@ -298,3 +298,15 @@
- assert:
that:
- '"ASYNC POLL on localhost" in callback_output.stdout'
+
+- name: run playbook in --check with task disabling check mode
+ command: ansible-playbook {{ role_path }}/check_task_test.yml --check
+ register: check_task_disabled_output
+ delegate_to: localhost
+ environment:
+ ANSIBLE_NOCOLOR: 'true'
+ ANSIBLE_FORCE_COLOR: 'false'
+
+- assert:
+ that:
+ - '"ASYNC OK on localhost" in check_task_disabled_output.stdout'