From 36632c95297365888488df6503b7380412288468 Mon Sep 17 00:00:00 2001 From: Henry Finucane Date: Sat, 31 May 2014 20:18:21 -0700 Subject: [PATCH 1/2] Ensure ansible_job_id exists even for not-started jobs --- lib/ansible/runner/poller.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ansible/runner/poller.py b/lib/ansible/runner/poller.py index 5fd3537480..0218481415 100644 --- a/lib/ansible/runner/poller.py +++ b/lib/ansible/runner/poller.py @@ -43,6 +43,7 @@ class AsyncPoller(object): self.active = True else: skipped = skipped and res.get('skipped', False) + self.runner.vars_cache[host]['ansible_job_id'] = '' self.results['contacted'][host] = res for (host, res) in results['dark'].iteritems(): self.runner.vars_cache[host]['ansible_job_id'] = '' From 9638ab973f13770b92477db581765b21ad196ece Mon Sep 17 00:00:00 2001 From: Henry Finucane Date: Sat, 12 Jul 2014 10:30:05 -0700 Subject: [PATCH 2/2] Add integration test --- test/integration/roles/test_async/tasks/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/integration/roles/test_async/tasks/main.yml b/test/integration/roles/test_async/tasks/main.yml index b83227791b..556284770a 100644 --- a/test/integration/roles/test_async/tasks/main.yml +++ b/test/integration/roles/test_async/tasks/main.yml @@ -56,3 +56,9 @@ - "'ansible_job_id' in async_result" - "'started' in async_result" - "'finished' not in async_result" + +- name: test skipped task handling + command: /bin/true + async: 15 + poll: 0 + when: False