feat: Add support for when on include_role

This commit is contained in:
Mohamed El Mouctar HAIDARA 2021-09-29 01:12:42 +02:00
parent efeb0b53e4
commit 585eb6311f
3 changed files with 4 additions and 2 deletions

View file

@ -11,6 +11,7 @@
- feat: Add option to automatically view the generated
file [\#88](https://github.com/haidaraM/ansible-playbook-grapher/pull/88)
- feat: Add support for block [\#86](https://github.com/haidaraM/ansible-playbook-grapher/pull/86)
- Add support for when on include_role
- fix:
- front: Refactor the JS part and fix issue when selecting/unselecting nodes
- front: Do not unhighlight the current selected node when hovering on parent node

View file

@ -236,8 +236,8 @@ class PlaybookParser(BaseParser):
f"An 'include_role' found. Including tasks from the role '{task_or_block.args['name']}'")
role_node = RoleNode(task_or_block.args['name'])
# TODO: add support for conditional (when) for include_role in the edge label
parent_nodes[-1].add_node(f"{node_type}s", EdgeNode(parent_nodes[-1], role_node))
parent_nodes[-1].add_node(f"{node_type}s", EdgeNode(parent_nodes[-1], role_node,
convert_when_to_str(task_or_block.when)))
if self.include_role_tasks:
# If we have an include_role and we want to include role tasks, the parent node now becomes

View file

@ -14,5 +14,6 @@
debug:
msg: "Debug 2"
- name: (4) Include role 2
when: x is not defined
include_role:
name: fake_role_2