mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07: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:
parent
6c2e4c1ca8
commit
f7ba63e047
2 changed files with 22 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue