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

Feature Request : Device interfaces as host_vars #9

Open
liorfranko opened this issue Nov 27, 2017 · 1 comment
Open

Feature Request : Device interfaces as host_vars #9

liorfranko opened this issue Nov 27, 2017 · 1 comment

Comments

@liorfranko
Copy link

Can you add the device interfaces as host_vars?

@marioland
Copy link

I have the same requirement: get an inventory of all devices with all their interfaces.

You can run the script
python netbox.py -c netbox.interfaces.yml --list
and in the netbox.interfaces.yml you set
api_url: 'http://netbox/api/dcim/interfaces/?device_id=1'
But then you have only the interfaces of one device.

When trying to get all devices with all its interfaces I would get a naming conflict in the host_vars, because interfaces on different devices have the same name.

I could then call the script one time for all the devices and then again for per device for its interfaces.
But this logic is a few lines of python code. I don't know how to do this purely in ansible.

Or is there a way to use this script in one shot( get an inventory of all devices with all their interfaces)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants