mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
add --step option to ansible-playbooks to let people step through a playbook
one by one - asking for confirmation along the way. also allows to 'continue' after a certain point
This commit is contained in:
@@ -464,7 +464,20 @@ class PlaybookCallbacks(object):
|
||||
msg = "TASK: [%s]" % name
|
||||
if is_conditional:
|
||||
msg = "NOTIFIED: [%s]" % name
|
||||
print banner(msg)
|
||||
|
||||
if 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
|
||||
print banner(msg)
|
||||
elif resp.lower() in ['c', 'continue']:
|
||||
self.skip_task = False
|
||||
self.step = False
|
||||
print banner(msg)
|
||||
else:
|
||||
self.skip_task = True
|
||||
|
||||
|
||||
call_callback_module('playbook_on_task_start', name, is_conditional)
|
||||
|
||||
def on_vars_prompt(self, varname, private=True, prompt=None, encrypt=None, confirm=False, salt_size=None, salt=None, default=None):
|
||||
|
||||
Reference in New Issue
Block a user