summaryrefslogtreecommitdiff
path: root/lib/ansible/callbacks.py
diff options
context:
space:
mode:
authorSeth Vidal <skvidal@fedoraproject.org>2013-04-09 01:53:40 -0400
committerSeth Vidal <skvidal@fedoraproject.org>2013-04-09 01:53:40 -0400
commit690738ea32a317ff6de4927d7168ba5053c49a87 (patch)
tree40218b27b2495fd9a429b0cbb49979e670f94ee4 /lib/ansible/callbacks.py
parent586ee923a611231eeea4b1f353a44ab15efb5c53 (diff)
downloadansible-690738ea32a317ff6de4927d7168ba5053c49a87.tar.gz
implement --start-at-task option to hop to a specific task before starting running them
Diffstat (limited to 'lib/ansible/callbacks.py')
-rw-r--r--lib/ansible/callbacks.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/ansible/callbacks.py b/lib/ansible/callbacks.py
index d241806740..cf204bbdb2 100644
--- a/lib/ansible/callbacks.py
+++ b/lib/ansible/callbacks.py
@@ -21,6 +21,7 @@ import getpass
import os
import subprocess
import random
+import fnmatch
from ansible.color import stringc
cowsay = None
@@ -460,8 +461,15 @@ class PlaybookCallbacks(object):
msg = "TASK: [%s]" % name
if is_conditional:
msg = "NOTIFIED: [%s]" % name
-
- if hasattr(self, 'step') and self.step:
+
+ if hasattr(self, 'start_at'):
+ if name == self.start_at or fnmatch.fnmatch(name, self.start_at):
+ # we found out match, we can get rid of this now
+ del self.start_at
+
+ if hasattr(self, 'start_at'): # we still have start_at so skip the task
+ self.skip_task = True
+ elif hasattr(self, 'step') and self.step:
resp = raw_input('Perform task: %s (y/n/c): ' % name)
if resp.lower() in ['y','yes']:
self.skip_task = False