Comments (13)
Released in 1.0.1
from ansible-playbook-grapher.
Thanks for reporting the issue. I reproduced it locally. I will make a release soon
from ansible-playbook-grapher.
Can you test with the latest dev release: pip install ansible-playbook-grapher==1.0.1.dev0
?
from ansible-playbook-grapher.
@haidaraM sure!
I get the following on 1.0.1.dev0, I tried two different playbooks that are both setup very similar in regards to the pre_tasks
, both result in same exception
. Let me know what else you would like me to test, would love to help straighten it out.
ansible-playbook-grapher nist_dsr_link_launch.yml -i inventory/hosts --vault-password-file $VAULT --include-role-tasks -e '@dsr_play_args.yml' --view
[WARNING]: ansible.utils.display.initialize_locale has not been called, this may result in incorrectly calculated text widths that can cause Display to print incorrect line lengths
Parsing Play: all (805) ********************************************************************************************************************************************************************************
Done parsing Play: all (805) ***************************************************************************************************************************************************************************
Parsing Play: all (805) ********************************************************************************************************************************************************************************
Traceback (most recent call last):
File "/Users/myUserName/.pyenv/versions/venvGraphAnsible/bin/ansible-playbook-grapher", line 8, in <module>
sys.exit(main())
File "/Users/myUserName/.pyenv/versions/3.10.0/envs/venvGraphAnsible/lib/python3.10/site-packages/ansibleplaybookgrapher/cli.py", line 126, in main
cli.run()
File "/Users/myUserName/.pyenv/versions/3.10.0/envs/venvGraphAnsible/lib/python3.10/site-packages/ansibleplaybookgrapher/cli.py", line 43, in run
playbook_node = parser.parse()
File "/Users/myUserName/.pyenv/versions/3.10.0/envs/venvGraphAnsible/lib/python3.10/site-packages/ansibleplaybookgrapher/parser.py", line 154, in parse
self._include_tasks_in_blocks(current_play=play, parent_nodes=[play_node], block=pre_task_block,
File "/Users/myUserName/.pyenv/versions/3.10.0/envs/venvGraphAnsible/lib/python3.10/site-packages/ansibleplaybookgrapher/parser.py", line 284, in _include_tasks_in_blocks
self._include_tasks_in_blocks(current_play=current_play, parent_nodes=parent_nodes, block=b,
File "/Users/myUserName/.pyenv/versions/3.10.0/envs/venvGraphAnsible/lib/python3.10/site-packages/ansibleplaybookgrapher/parser.py", line 230, in _include_tasks_in_blocks
self._include_tasks_in_blocks(current_play=current_play, parent_nodes=parent_nodes, block=task_or_block,
File "/Users/myUserName/.pyenv/versions/3.10.0/envs/venvGraphAnsible/lib/python3.10/site-packages/ansibleplaybookgrapher/parser.py", line 308, in _include_tasks_in_blocks
self._add_task(task=task_or_block, task_vars=play_vars, node_type=node_type,
File "/Users/myUserName/.pyenv/versions/3.10.0/envs/venvGraphAnsible/lib/python3.10/site-packages/ansibleplaybookgrapher/parser.py", line 86, in _add_task
parent_node.add_node(target_composition=f"{node_type}s", node=edge_node)
File "/Users/myUserName/.pyenv/versions/3.10.0/envs/venvGraphAnsible/lib/python3.10/site-packages/ansibleplaybookgrapher/graph.py", line 58, in add_node
raise Exception(
Exception: The target composition 'pre_tasks' is unknown. Supported are: ['tasks']
from ansible-playbook-grapher.
Can you send me a minimal example that is failing and the output of ansible-playbook-grapher --version
?
from ansible-playbook-grapher.
from ansible-playbook-grapher.
Yes, there is a more verbose mode: ansible-playbook-grapher -vvvv ...
. Can you send me the output with this flag ?
Are you using some includes or imports inside your pre_tasks ?
from ansible-playbook-grapher.
The verbose
mode helped track it down further!
When I comment out the pre_tasks
the tool does run with no exceptions, but gives me this error, and the resulting graph line headings and identifiers are all misaligned.
[WARNING]: ansible.utils.display.initialize_locale has not been called, this may result in incorrectly
calculated text widths that can cause Display to print incorrect line lengths
I am using includes and imports in pre_tasks
, and that appears to be where it fails, it hits my pre_tasks
, which does an include of analyze
, inside analyze
, the main.yml
does import
of 3 task files from the analyze
role, and it fails when it hits that first task file, which also has a block
.
Here is the exception and setup when pre_tasks
is in the play
:
Parsing Play: all (805) *********************************************************************************
Parsing pre_tasks...
Adding pre_task 'Verify Vars Needed For This Playbook At Initial Launch Are Present.' to the graph
Adding pre_task 'Verify Reachability and Authentication, Or FAIL The Host.' to the graph
Adding pre_task 'pre_task_work : Assert The User Provided Email Address Was Formatted Correctly As A List Or Fail The Host.' to the graph
Adding pre_task 'pre_task_work : Assert The User Provided Email Addresses Do Not Contain White Space And Are Addressed To @.com Domains Only Or Fail The Host.' to the graph
Adding pre_task 'pre_task_work : Set Fact Containing The User Provided Email List Plus default address WHEN: user_email_list > 0, ELSE Skipped.' to the graph
Adding pre_task 'pre_task_work : Set Fact Containing The default address Email WHEN: user_email_list == 0, ELSE Skipped.' to the graph
An 'include_role' found. Including tasks from the role 'analyze'
statically imported: myProjectDir/roles/analyze/tasks/analyze_cpm_filter_status.yml
Loading collection ansible.utils from myProjectDir/collections/ansible_collections/ansible/utils
statically imported: myProjectDir/roles/analyze/tasks/analyze_ip_filter_action.yml
statically imported: myProjectDir/roles/analyze/tasks/analyze_ipv6_filter_action.yml
Adding pre_task 'analyze : Gather Current Configured CPM State.' to the graph
Traceback (most recent call last):
File "/Users/myUserName/.pyenv/versions/venvGraphAnsible/bin/ansible-playbook-grapher", line 8, in <module>
sys.exit(main())
role/tasks/analyze/main.yml
- name: 'Include Validate CPM filter State.'
ansible.builtin.import_tasks: analyze_cpm_filter_status.yml
- name: 'Include: Validate IP Filters And Associated Actions.'
ansible.builtin.import_tasks: analyze_ip_filter_action.yml
when:
- inventory_hostname not in groups['mtso']
- name: 'Include: Validate IPv6 Filters And Associated Actions.'
ansible.builtin.import_tasks: analyze_ipv6_filter_action.yml
when:
- inventory_hostname in groups['mgmtspe']
analyze_cpm_filter_status.yml
- name: 'Analyzing CPM Filter State(s).'
block:
- name: 'Gather Current Configured CPM State.'
ansible.netcommon.cli_command:
command: show system security cpm-filter ip-filter
connection: ansible.netcommon.network_cli
register: nokia_show_system_security_cpmfilter_ipfilter
from ansible-playbook-grapher.
Can you try the latest version on the branch fix/blocks with pip install git+https://github.com/haidaraM/ansible-playbook-grapher@fix/blocks
?
The warning on display should have no impact on the generated graph. Can you share a screenshot with the misaligned headlings ?
from ansible-playbook-grapher.
Same result with the new pip installed library version from Git, do you have an email address I can send the screenshots to? I would prefer not to have some of the content out in the open.
from ansible-playbook-grapher.
Hmm there should be another case I'm not testing at the moment... Can you just uninstall and start from scratch with the latest version on the branch ? Just to be sure
My email: [email protected]
from ansible-playbook-grapher.
Emailed you @haidaraM
from ansible-playbook-grapher.
Just saw your mail and replied to it. So a complete reinstall fixed the main issue. For the rendering issue with big playbooks and large number of tasks, I will create another issue.
from ansible-playbook-grapher.
Related Issues (20)
- [Feature request] Add rendered graphs to pull requests
- [Feature request] Multiple playbooks in one graph HOT 6
- [Bug report] ansible-playbook-grapher doesnt work with ansible-core 2.13.1
- After upgrading from 1.1.2 to 1.1.3 HOT 5
- [Bug report] Fix Maximum call stack size exceeded
- ansible-playbook-grapher fails with different errors in different versions after upgrading from 1.1.2 to 1.2.0 HOT 3
- [Feature request] Variable mapping option HOT 2
- [Feature request] generate mermaid instead of images HOT 7
- [Bug report] Please bump version of ansible-core HOT 8
- [Feature request] Include inventory graphing and make this the ansible-super-grapher HOT 1
- [Feature request] Version Bump :) HOT 2
- [Feature request] Automage releases via Github
- Does the tool have run playbooks first? HOT 3
- [Feature request] Add a key to hide plays(tasks) without any role HOT 11
- [Bug report] No support for playbooks using `import_tasks` HOT 2
- [Feature request] Add JSON renderer for later consumption by third party tools HOT 1
- [Bug report] Graphviz : properly rank the edges
- [Bug report] TypeError: 'str' object is not callable HOT 7
- [Bug report] Graphviz Rendering: improvements for large number of plays and tasks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-playbook-grapher.