mirror of
https://github.com/haidaraM/ansible-playbook-grapher
synced 2024-11-10 06:04:15 +00:00
feat: Add support for when on include_role
This commit is contained in:
parent
efeb0b53e4
commit
585eb6311f
3 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
1
tests/fixtures/include_role.yml
vendored
1
tests/fixtures/include_role.yml
vendored
|
@ -14,5 +14,6 @@
|
|||
debug:
|
||||
msg: "Debug 2"
|
||||
- name: (4) Include role 2
|
||||
when: x is not defined
|
||||
include_role:
|
||||
name: fake_role_2
|
||||
|
|
Loading…
Reference in a new issue