Comments (5)
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the component bot command.
from ansible.
This is not really an ansible-inventory
issue but how the script
inventory plugin works.
from ansible.
Closing as above- if you need to debug a script, just run the script (or better yet: write an inventory plugin and use a debugger).
from ansible.
@nitzmahone I ran the script from command line (./myscript.py) withtout error and could print / breakpoint().
But could not print anything to screen and brakpoint() / pdb.set_trace() would hang if ran from ansible-inventory .
I am not sure whether starting to write my own plugin for debugging purposes on a tool i am still learning would end successfully. Maybe i was not clear enough, thanks for your answer, sorry for the disturbance.
from ansible.
Inventory plugins are far more capable, flexible, and debuggable than inventory scripts in pretty much every way, so especially if you're writing in Python, I'd strongly suggest writing an inventory plugin instead of a script. They don't rely on stdout JSON dumping and have an actual API for interacting with Ansible.
That said, if you really need to debug a Python inventory script, I'd suggest using a debugger that supports debugging subprocesses (eg ipdb, pycharm/pydevd, VSCode). There are ways to get pdb to do that too, but it's a pain.
from ansible.
Related Issues (20)
- Variable `services` set by ansible.builtin.service_facts HOT 2
- ansible errors on ansible.builtin.synchronize (caused by buffer overflow) HOT 1
- dnf module overrides conf_file with its default values HOT 4
- Play vars not present in hostvars HOT 4
- Add ability to set check mode via environment variable HOT 2
- `ansible-inventory --list` JSON output shows unsafe values as dictionaries with `__ansible_unsafe` key HOT 13
- Non-default variables defined in explicit localhost inventory are not present in hostvars HOT 5
- Feature Req: Display date/time stamp during playbooks run using verbose? HOT 3
- ansible hang when execute the sshfs mount command HOT 3
- copy module: modify time on the file (mtime) is not updating HOT 3
- 'reboot' module not working as expected: failure to setup for boot_time_command's execution gets treated as result of boot_time_command HOT 1
- No linear execution in handler after include_tasks with when condition HOT 4
- pkg_mgr.py looks in wrong directories for installp and dnf on AIX 7(.2) HOT 10
- ansible-inventory -i inventory_file.json --list doesn't accept list for hostgoups requires dict object HOT 4
- Key auth on paramiko 3.4.0 fails to connect to older hosts HOT 1
- Is this provided example in csvfile_lookup plugin correct? HOT 2
- The Python 2 yum module is needed for this module. If you require Python 3 support use the `dnf` Ansible module instead. HOT 3
- Add docs for setting up ansible-test HOT 1
- Cron module using cron_file does not remove file when state=absent HOT 3
- ansible-galaxy role install changing symbolic link route HOT 3
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.