-
Notifications
You must be signed in to change notification settings - Fork 66
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
Adding Ansible Inventory code back here #243
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please make this nsot.contrib.ansible.inventory.nsot
? And please remember to add the __init__.py
files in the empty directories. 😬
I think we should go ahead and add a section to the docs for Ansible support as well if you're interested. If not, I can do that part.
Depending on number of devices in NSoT, could be rather slow since this | ||
has to request every device resource to filter through | ||
''' | ||
device = [i for i in self.client.devices.get()['data']['devices'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this compatible w/ NSoT v1.x please remove ['data']['devices']
. The .get()
call on its own is good.
|
||
# Would do a list comprehension here, but would like to save code/time | ||
# and also acquire attributes in this step | ||
for host in devices['data']['devices']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here: Ditch ['data']['devices']
. 🎱
All paths are up to date, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I thought we agreed on making the contrib directory an actual package, which means this whole contrib
tree needs to be moved into the nsot
directory.
Then each directory under it needs to have an __init__.py
file so that the paths can be correctly imported.
Ya dig?
Also, sorry about the delay in response. I just got back from holiday today!!
bump |
At this point the only thing missing are the |
af952b2 has the init.py files |
Allan Swanepoel seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Will start working on extending the dynamic inventory code in the next couple of days, but thought of having it here for better local visibility.
Also, this would most likely become a sub module / standalone python package for ease of deployment - Could we create a dropbox/nsot-inventory Repo to house it in?
It will also allow for improved testing of this module