Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update ansible-core requirement from <2.16,>=2.15 to >=2.15,<2.17 #164

Merged
merged 3 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions ansibleplaybookgrapher/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
from ansible.cli import CLI
from ansible.errors import AnsibleParserError, AnsibleUndefinedVariable, AnsibleError
from ansible.parsing.yaml.objects import AnsibleUnicode
from ansible.playbook import Playbook, Play
from ansible.playbook import Playbook
from ansible.playbook.block import Block
from ansible.playbook.helpers import load_list_of_blocks
from ansible.playbook.play import Play
from ansible.playbook.role import Role
from ansible.playbook.role_include import IncludeRole
from ansible.playbook.task import Task
from ansible.playbook.task_include import TaskInclude
Expand Down Expand Up @@ -213,13 +215,18 @@ def parse(self, *args, **kwargs) -> PlaybookNode:
# loop through the roles
display.v("Parsing roles...")

for role in play.get_roles():
for role in play.get_roles(): # type: Role
# Don't insert tasks from ``import/include_role``, preventing duplicate graphing
if role.from_include:
continue

# the role object doesn't inherit the tags from the play. So we add it manually.
role.tags = role.tags + play.tags

# More context on this line, see here: https://github.com/ansible/ansible/issues/82310
# This seems to work for now.
role._parent = None

if not role.evaluate_tags(
only_tags=self.tags, skip_tags=self.skip_tags, all_vars=play_vars
):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ansible-core>=2.15,<2.15.5
ansible-core>=2.15,<2.16.1
graphviz>=0.18,<1
colour<1
lxml<6
Expand Down