diff --git a/ansibleplaybookgrapher/grapher.py b/ansibleplaybookgrapher/grapher.py index d3d7f932..1562b8d5 100644 --- a/ansibleplaybookgrapher/grapher.py +++ b/ansibleplaybookgrapher/grapher.py @@ -124,7 +124,9 @@ def _graph_task(self, task: Task, loop_counter: int, task_vars: Dict, graph: Cus task_id = generate_id(id_prefix) edge_id = generate_id("edge_") - graph.node(task_id, label=task_name, shape="octagon", id=task_id, tooltip=task_name) + # the task path is something like this: ${absolute_path_to_the_file}:${task_line_number} + task_path = task.get_path().split(":")[0] + graph.node(task_id, label=task_name, shape="octagon", id=task_id, tooltip=task_name, URL=task_path) graph.edge(parent_node_name, task_id, label=task_edge_label, color=color, fontcolor=color, style="bold", id=edge_id) self.graph_representation.add_link(parent_node_id, edge_id)