ansible_modules icon indicating copy to clipboard operation
ansible_modules copied to clipboard

[Feature]: Add vm assigned device to inventory vars

Open fprina opened this issue 3 years ago • 1 comments

NetBox version

v3.3.5

Feature type

Change to existing Module

Proposed functionality

In the inventory variables related to a virtual machine should be present the assigned device

According to the web interface restrictions I suppose the right var name is cluster_device

For esample vm1 in the demo site is assigned to a specific device so ansible-inventory --host vm1 should return:

{ "cluster": "DO-AMS3", "cluster_device": "NCblade[0-3]" "cluster_group": "emea", "cluster_type": "digitalocean", "custom_fields": {}, "device_roles": [ "application-server" ], "is_virtual": true, "local_context_data": [ null ], "locations": [], "platforms": [ "ubuntu-linux-20-04" ], "regions": [], "services": [], "site_groups": [], "status": { "label": "Active", "value": "active" }, "tags": [] }

Use case

use the assigned device directly in the ansible playbooks

External dependencies

No response

fprina avatar Oct 21 '22 20:10 fprina

Nice enhancement request, is anyone out there working on this?

joek-office avatar Feb 13 '24 09:02 joek-office