mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Add shorthand debugger method to recreate the task from the original ds (#46987)
* Add shorthand debugger method to recreate the task from the original ds, and re-template. Fixes #46321 * Fix rst header * Indicate update_task was added in 2.8
This commit is contained in:
@@ -1200,6 +1200,16 @@ class Debugger(cmd.Cmd):
|
||||
|
||||
do_r = do_redo
|
||||
|
||||
def do_update_task(self, args):
|
||||
"""Recreate the task from ``task._ds``, and template with updated ``task_vars``"""
|
||||
templar = Templar(None, shared_loader_obj=None, variables=self.scope['task_vars'])
|
||||
task = self.scope['task']
|
||||
task = task.load_data(task._ds)
|
||||
task.post_validate(templar)
|
||||
self.scope['task'] = task
|
||||
|
||||
do_u = do_update_task
|
||||
|
||||
def evaluate(self, args):
|
||||
try:
|
||||
return eval(args, globals(), self.scope)
|
||||
|
||||
Reference in New Issue
Block a user