diff --git a/lib/ansible/executor/play_iterator.py b/lib/ansible/executor/play_iterator.py index 07b890c4201..833ee86d419 100644 --- a/lib/ansible/executor/play_iterator.py +++ b/lib/ansible/executor/play_iterator.py @@ -19,6 +19,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type +import fnmatch + from ansible import constants as C from ansible.errors import * @@ -108,10 +110,10 @@ class PlayIterator: (s, task) = self.get_next_task_for_host(host, peek=True) if s.run_state == self.ITERATING_COMPLETE: break - if task.get_name() != play_context.start_at_task: - self.get_next_task_for_host(host) - else: + if task.name == play_context.start_at_task or fnmatch.fnmatch(task.name, play_context.start_at_task): break + else: + self.get_next_task_for_host(host) # Extend the play handlers list to include the handlers defined in roles self._play.handlers.extend(play.compile_roles_handlers()) diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py index 762f3ce6cb0..8b856310dc2 100644 --- a/lib/ansible/playbook/play_context.py +++ b/lib/ansible/playbook/play_context.py @@ -31,6 +31,7 @@ from ansible.playbook.attribute import Attribute, FieldAttribute from ansible.playbook.base import Base from ansible.template import Templar from ansible.utils.boolean import boolean +from ansible.utils.unicode import to_unicode __all__ = ['PlayContext'] @@ -251,7 +252,7 @@ class PlayContext(Base): if hasattr(options, 'step') and options.step: self.step = boolean(options.step) if hasattr(options, 'start_at_task') and options.start_at_task: - self.start_at_task = options.start_at_task + self.start_at_task = to_unicode(options.start_at_task) # get the tag info from options, converting a comma-separated list # of values into a proper list if need be. We check to see if the