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

Fix include in loop when stategy=free (#33094)

This commit is contained in:
Martin Krizek 2017-11-27 17:02:47 +01:00 committed by jctanner
parent e65ef09aa9
commit 3a2a1e054f
5 changed files with 20 additions and 1 deletions

View file

@ -431,7 +431,7 @@ class PlayIterator:
# we're advancing blocks, so if this was an end-of-role block we # we're advancing blocks, so if this was an end-of-role block we
# mark the current role complete # mark the current role complete
if block._eor and host.name in block._role._had_task_run and not in_child: if block._eor and host.name in block._role._had_task_run and not in_child and not peek:
block._role._completed[host.name] = True block._role._completed[host.name] = True
else: else:
task = block.always[state.cur_always_task] task = block.always[state.cur_always_task]

View file

@ -0,0 +1,2 @@
- set_fact:
inner: "reached"

View file

@ -0,0 +1,6 @@
- name: this needs to be here
debug:
msg: "hello"
- include: inner.yml
with_items:
- '1'

View file

@ -0,0 +1,9 @@
- hosts: testhost
gather_facts: no
strategy: free
roles:
- test_includes_free
tasks:
- assert:
that:
- "inner == 'reached'"

View file

@ -1,3 +1,5 @@
- include: test_includes2.yml parameter1=asdf parameter2=jkl - include: test_includes2.yml parameter1=asdf parameter2=jkl
- include: test_includes3.yml - include: test_includes3.yml
- include: test_include_free.yml