mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 22:11:44 -07:00
Adding back --start-at-task feature
Also implemented framework for --step, though it's not used yet
This commit is contained in:
parent
f6c64a8c00
commit
8d887d8dd3
3 changed files with 21 additions and 4 deletions
|
@ -99,6 +99,17 @@ class PlayIterator:
|
|||
self._host_states = {}
|
||||
for host in inventory.get_hosts(self._play.hosts):
|
||||
self._host_states[host.name] = HostState(blocks=self._blocks)
|
||||
# if we're looking to start at a specific task, iterate through
|
||||
# the tasks for this host until we find the specified task
|
||||
if connection_info.start_at_task is not None:
|
||||
while True:
|
||||
(s, task) = self.get_next_task_for_host(host, peek=True)
|
||||
if s.run_state == self.ITERATING_COMPLETE:
|
||||
break
|
||||
if task.get_name() != connection_info.start_at_task:
|
||||
self.get_next_task_for_host(host)
|
||||
else:
|
||||
break
|
||||
|
||||
# Extend the play handlers list to include the handlers defined in roles
|
||||
self._play.handlers.extend(play.compile_roles_handlers())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue