From 273f322717e27453fbac38f98c7b53b1ab80e92b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Tue, 13 Feb 2024 11:30:40 +0100
Subject: [PATCH 01/15] add support to fetch cluster device from netbox.
 corresponding to issue
 https://github.com/netbox-community/ansible_modules/issues/852

---
 plugins/inventory/nb_inventory.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/plugins/inventory/nb_inventory.py b/plugins/inventory/nb_inventory.py
index da9f5ed72..dd9267918 100644
--- a/plugins/inventory/nb_inventory.py
+++ b/plugins/inventory/nb_inventory.py
@@ -537,6 +537,7 @@ def group_extractors(self):
             "custom_fields": self.extract_custom_fields,
             "region": self.extract_regions,
             "cluster": self.extract_cluster,
+            "cluster_device": self.extract_cluster_device,
             "cluster_group": self.extract_cluster_group,
             "cluster_type": self.extract_cluster_type,
             "is_virtual": self.extract_is_virtual,
@@ -943,6 +944,13 @@ def extract_cluster(self, host):
         except Exception:
             return
 
+    def extract_cluster_device(self, host):
+        try:
+            # cluster device does not have a slug
+            return host["device"]["name"]
+        except Exception:
+            return
+
     def extract_cluster_group(self, host):
         try:
             return self.clusters_group_lookup[host["cluster"]["id"]]

From 704186baf0144fab60a9a5a40126536f9029563c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Wed, 14 Feb 2024 08:28:23 +0100
Subject: [PATCH 02/15] extract data without try/catch and return in any case a
 suitable value

---
 plugins/inventory/nb_inventory.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/plugins/inventory/nb_inventory.py b/plugins/inventory/nb_inventory.py
index dd9267918..cea00f730 100644
--- a/plugins/inventory/nb_inventory.py
+++ b/plugins/inventory/nb_inventory.py
@@ -945,11 +945,11 @@ def extract_cluster(self, host):
             return
 
     def extract_cluster_device(self, host):
-        try:
-            # cluster device does not have a slug
-            return host["device"]["name"]
-        except Exception:
-            return
+        # cluster device does not have a slug
+        if host.get("device", None) == None:
+            return ""
+        else:
+            return host.get("device", { "name": "" }).get("name","")
 
     def extract_cluster_group(self, host):
         try:

From 1f83775aab4295e185548aee2da88298b9b64650 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Wed, 14 Feb 2024 10:02:27 +0100
Subject: [PATCH 03/15] fix ci linting run black error

---
 plugins/inventory/nb_inventory.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/inventory/nb_inventory.py b/plugins/inventory/nb_inventory.py
index cea00f730..c7431d051 100644
--- a/plugins/inventory/nb_inventory.py
+++ b/plugins/inventory/nb_inventory.py
@@ -949,7 +949,7 @@ def extract_cluster_device(self, host):
         if host.get("device", None) == None:
             return ""
         else:
-            return host.get("device", { "name": "" }).get("name","")
+            return host.get("device", { "name": ""}).get("name","")
 
     def extract_cluster_group(self, host):
         try:

From c07f1d2e347c0bc925e57b4b570ac258ed16e7f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Wed, 14 Feb 2024 10:05:24 +0100
Subject: [PATCH 04/15] fix ci linting run black error - second try

---
 .gitignore                        | 2 ++
 install.sh                        | 5 +++++
 plugins/inventory/nb_inventory.py | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100755 install.sh

diff --git a/.gitignore b/.gitignore
index a7035db33..8fbabbd53 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,8 @@ venv/
 changelogs/.plugin-cache.yaml
 docs/_build/*
 .python-version
+inventory/
+ansible.yml
 
 # https://github.com/ansible/ansible/issues/68499
 # ansible_collections/
diff --git a/install.sh b/install.sh
new file mode 100755
index 000000000..9a047895d
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+rm netbox-netbox-3.16.0.tar.gz
+ansible-galaxy collection build .
+ansible-galaxy collection install -f netbox-netbox-3.16.0.tar.gz
\ No newline at end of file
diff --git a/plugins/inventory/nb_inventory.py b/plugins/inventory/nb_inventory.py
index c7431d051..eee7ac944 100644
--- a/plugins/inventory/nb_inventory.py
+++ b/plugins/inventory/nb_inventory.py
@@ -949,7 +949,7 @@ def extract_cluster_device(self, host):
         if host.get("device", None) == None:
             return ""
         else:
-            return host.get("device", { "name": ""}).get("name","")
+            return host.get("device", {"name": ""}).get("name", "")
 
     def extract_cluster_group(self, host):
         try:

From da1e90a0e398389695d68f59b783643b4ced50cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Wed, 14 Feb 2024 10:18:13 +0100
Subject: [PATCH 05/15] update tests to expect the new data field in test
 return.

---
 tests/unit/inventory/test_data/group_extractors/data.json | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/unit/inventory/test_data/group_extractors/data.json b/tests/unit/inventory/test_data/group_extractors/data.json
index a0a39ffe1..de4506462 100644
--- a/tests/unit/inventory/test_data/group_extractors/data.json
+++ b/tests/unit/inventory/test_data/group_extractors/data.json
@@ -14,6 +14,7 @@
             "custom_fields",
             "region",
             "cluster",
+            "cluster_device",
             "cluster_group",
             "cluster_type",
             "is_virtual",
@@ -56,6 +57,7 @@
             "custom_fields",
             "region",
             "cluster",
+            "cluster_device",
             "cluster_group",
             "cluster_type",
             "is_virtual",
@@ -97,6 +99,7 @@
             "custom_fields",
             "region",
             "cluster",
+            "cluster_device",
             "cluster_group",
             "cluster_type",
             "is_virtual",

From 0d424e67e7372474b4e25f8a45eb642f3e769d92 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Wed, 14 Feb 2024 10:23:54 +0100
Subject: [PATCH 06/15] fix pylint error with singleton comparison

---
 plugins/inventory/nb_inventory.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/inventory/nb_inventory.py b/plugins/inventory/nb_inventory.py
index eee7ac944..6c8ca958e 100644
--- a/plugins/inventory/nb_inventory.py
+++ b/plugins/inventory/nb_inventory.py
@@ -946,7 +946,7 @@ def extract_cluster(self, host):
 
     def extract_cluster_device(self, host):
         # cluster device does not have a slug
-        if host.get("device", None) == None:
+        if host.get("device", None) is None:
             return ""
         else:
             return host.get("device", {"name": ""}).get("name", "")

From 9c4a7866ddbef4bc4f51b8ca77155576c1991804 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Wed, 14 Feb 2024 11:47:40 +0100
Subject: [PATCH 07/15] netbox-deploy.py - rearrange netbox data population to
 assign a device (test100) to a cluster (testcluster) - later assign this
 device to test100_vm as the device in cluster where it should be placed

test-inventory-*
- edit inventorys to respect the new bevaviour with the cluster_device data field
---
 tests/integration/netbox-deploy.py            | 65 ++++++++++---------
 .../files/test-inventory-bearer-token.json    |  5 ++
 .../files/test-inventory-jinja2-filter.json   |  4 ++
 .../files/test-inventory-jinja2.json          |  5 ++
 .../files/test-inventory-legacy.json          |  5 ++
 .../files/test-inventory-noracks.json         |  5 ++
 .../files/test-inventory-options-flatten.json |  5 ++
 .../files/test-inventory-options.json         |  5 ++
 .../files/test-inventory-plurals-flatten.json |  5 ++
 .../files/test-inventory-plurals.json         |  5 ++
 .../inventory-v3.5/files/test-inventory.json  |  5 ++
 .../files/test-inventory-bearer-token.json    |  5 ++
 .../files/test-inventory-jinja2-filter.json   |  4 ++
 .../files/test-inventory-jinja2.json          |  5 ++
 .../files/test-inventory-legacy.json          |  5 ++
 .../files/test-inventory-noracks.json         |  5 ++
 .../files/test-inventory-options-flatten.json |  5 ++
 .../files/test-inventory-options.json         |  5 ++
 .../files/test-inventory-plurals-flatten.json |  5 ++
 .../files/test-inventory-plurals.json         |  5 ++
 .../inventory-v3.6/files/test-inventory.json  |  5 ++
 .../files/test-inventory-bearer-token.json    |  5 ++
 .../files/test-inventory-jinja2-filter.json   |  4 ++
 .../files/test-inventory-jinja2.json          |  5 ++
 .../files/test-inventory-legacy.json          |  5 ++
 .../files/test-inventory-noracks.json         |  5 ++
 .../files/test-inventory-options-flatten.json |  5 ++
 .../files/test-inventory-options.json         |  5 ++
 .../files/test-inventory-plurals-flatten.json |  5 ++
 .../files/test-inventory-plurals.json         |  5 ++
 .../inventory-v3.7/files/test-inventory.json  |  5 ++
 31 files changed, 180 insertions(+), 32 deletions(-)

diff --git a/tests/integration/netbox-deploy.py b/tests/integration/netbox-deploy.py
index 90cff633c..13009df50 100755
--- a/tests/integration/netbox-deploy.py
+++ b/tests/integration/netbox-deploy.py
@@ -296,6 +296,37 @@ def make_netbox_calls(endpoint, payload):
 test_rack = nb.dcim.racks.get(name="Test Rack")  # racks don't have slugs
 test_rack_site2 = nb.dcim.racks.get(name="Test Rack Site 2")
 
+## Create Cluster Group
+cluster_groups = [{"name": "Test Cluster Group", "slug": "test-cluster-group"}]
+created_cluster_groups = make_netbox_calls(
+    nb.virtualization.cluster_groups, cluster_groups
+)
+test_cluster_group = nb.virtualization.cluster_groups.get(slug="test-cluster-group")
+
+## Create Cluster Type
+cluster_types = [{"name": "Test Cluster Type", "slug": "test-cluster-type"}]
+created_cluster_types = make_netbox_calls(
+    nb.virtualization.cluster_types, cluster_types
+)
+test_cluster_type = nb.virtualization.cluster_types.get(slug="test-cluster-type")
+
+## Create Cluster
+clusters = [
+    {
+        "name": "Test Cluster",
+        "type": test_cluster_type.id,
+        "group": test_cluster_group.id,
+        "site": test_site.id,
+    },
+    {
+        "name": "Test Cluster 2",
+        "type": test_cluster_type.id,
+    },
+]
+created_clusters = make_netbox_calls(nb.virtualization.clusters, clusters)
+test_cluster = nb.virtualization.clusters.get(name="Test Cluster")
+test_cluster2 = nb.virtualization.clusters.get(name="Test Cluster 2")
+
 
 ## Create Devices
 devices = [
@@ -307,6 +338,7 @@ def make_netbox_calls(endpoint, payload):
         "local_context_data": {"ntp_servers": ["pool.ntp.org"]},
         "serial": "FAB01234567",
         "asset_tag": "123456789",
+        "cluster": test_cluster.id,
     },
     {
         "name": "TestDeviceR1",
@@ -419,40 +451,9 @@ def make_netbox_calls(endpoint, payload):
 rirs = [{"name": "Example RIR", "slug": "example-rir"}]
 created_rirs = make_netbox_calls(nb.ipam.rirs, rirs)
 
-## Create Cluster Group
-cluster_groups = [{"name": "Test Cluster Group", "slug": "test-cluster-group"}]
-created_cluster_groups = make_netbox_calls(
-    nb.virtualization.cluster_groups, cluster_groups
-)
-test_cluster_group = nb.virtualization.cluster_groups.get(slug="test-cluster-group")
-
-## Create Cluster Type
-cluster_types = [{"name": "Test Cluster Type", "slug": "test-cluster-type"}]
-created_cluster_types = make_netbox_calls(
-    nb.virtualization.cluster_types, cluster_types
-)
-test_cluster_type = nb.virtualization.cluster_types.get(slug="test-cluster-type")
-
-## Create Cluster
-clusters = [
-    {
-        "name": "Test Cluster",
-        "type": test_cluster_type.id,
-        "group": test_cluster_group.id,
-        "site": test_site.id,
-    },
-    {
-        "name": "Test Cluster 2",
-        "type": test_cluster_type.id,
-    },
-]
-created_clusters = make_netbox_calls(nb.virtualization.clusters, clusters)
-test_cluster = nb.virtualization.clusters.get(name="Test Cluster")
-test_cluster2 = nb.virtualization.clusters.get(name="Test Cluster 2")
-
 ## Create Virtual Machine
 virtual_machines = [
-    {"name": "test100-vm", "cluster": test_cluster.id},
+    {"name": "test100-vm", "cluster": test_cluster.id, "device": test100.id},
     {"name": "test101-vm", "cluster": test_cluster.id},
     {"name": "test102-vm", "cluster": test_cluster.id},
     {"name": "test103-vm", "cluster": test_cluster.id},
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json
index 360a7ac33..64478c218 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json
@@ -730,6 +730,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -883,6 +884,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1036,6 +1038,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1058,6 +1061,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1080,6 +1084,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json
index 6d7249836..44d4a173f 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json
@@ -613,6 +613,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -766,6 +767,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -919,6 +921,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -941,6 +944,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2.json
index 119e5633d..7322bc54b 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2.json
@@ -142,6 +142,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -161,6 +162,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -180,6 +182,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -199,6 +202,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -218,6 +222,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-legacy.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-legacy.json
index 6df5dbf2b..168c09f86 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-legacy.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-legacy.json
@@ -278,6 +278,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -303,6 +304,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -328,6 +330,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -353,6 +356,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -378,6 +382,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-noracks.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-noracks.json
index b61454e00..7a67324f5 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-noracks.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-noracks.json
@@ -769,6 +769,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -928,6 +929,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1087,6 +1089,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1115,6 +1118,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1143,6 +1147,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-options-flatten.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-options-flatten.json
index 8e019bd84..9bf028960 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-options-flatten.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-options-flatten.json
@@ -738,6 +738,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [
@@ -889,6 +890,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [
@@ -1040,6 +1042,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
@@ -1060,6 +1063,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
@@ -1080,6 +1084,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-options.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-options.json
index 119e5633d..7322bc54b 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-options.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-options.json
@@ -142,6 +142,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -161,6 +162,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -180,6 +182,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -199,6 +202,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -218,6 +222,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals-flatten.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals-flatten.json
index bf84ee743..e8fa4cbe1 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals-flatten.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals-flatten.json
@@ -187,6 +187,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -210,6 +211,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -233,6 +235,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -256,6 +259,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -279,6 +283,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
                 "local_context_data": [
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json
index 22f9d4e5f..7e414dce5 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json
@@ -790,6 +790,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -950,6 +951,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1110,6 +1112,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1139,6 +1142,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1168,6 +1172,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory.json b/tests/integration/targets/inventory-v3.5/files/test-inventory.json
index 360a7ac33..64478c218 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory.json
@@ -730,6 +730,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -883,6 +884,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1036,6 +1038,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1058,6 +1061,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1080,6 +1084,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json
index 360a7ac33..64478c218 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json
@@ -730,6 +730,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -883,6 +884,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1036,6 +1038,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1058,6 +1061,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1080,6 +1084,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2-filter.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2-filter.json
index 6d7249836..44d4a173f 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2-filter.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2-filter.json
@@ -613,6 +613,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -766,6 +767,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -919,6 +921,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -941,6 +944,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2.json
index 119e5633d..7322bc54b 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2.json
@@ -142,6 +142,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -161,6 +162,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -180,6 +182,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -199,6 +202,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -218,6 +222,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-legacy.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-legacy.json
index 6df5dbf2b..168c09f86 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-legacy.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-legacy.json
@@ -278,6 +278,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -303,6 +304,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -328,6 +330,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -353,6 +356,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -378,6 +382,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-noracks.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-noracks.json
index b61454e00..7a67324f5 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-noracks.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-noracks.json
@@ -769,6 +769,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -928,6 +929,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1087,6 +1089,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1115,6 +1118,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1143,6 +1147,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-options-flatten.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-options-flatten.json
index 8e019bd84..9bf028960 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-options-flatten.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-options-flatten.json
@@ -738,6 +738,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [
@@ -889,6 +890,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [
@@ -1040,6 +1042,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
@@ -1060,6 +1063,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
@@ -1080,6 +1084,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-options.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-options.json
index 119e5633d..7322bc54b 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-options.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-options.json
@@ -142,6 +142,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -161,6 +162,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -180,6 +182,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -199,6 +202,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -218,6 +222,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals-flatten.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals-flatten.json
index bf84ee743..e8fa4cbe1 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals-flatten.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals-flatten.json
@@ -187,6 +187,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -210,6 +211,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -233,6 +235,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -256,6 +259,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -279,6 +283,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
                 "local_context_data": [
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals.json
index 22f9d4e5f..7e414dce5 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals.json
@@ -790,6 +790,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -950,6 +951,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1110,6 +1112,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1139,6 +1142,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1168,6 +1172,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory.json b/tests/integration/targets/inventory-v3.6/files/test-inventory.json
index 360a7ac33..64478c218 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory.json
@@ -730,6 +730,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -883,6 +884,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1036,6 +1038,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1058,6 +1061,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1080,6 +1084,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json
index 360a7ac33..64478c218 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json
@@ -730,6 +730,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -883,6 +884,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1036,6 +1038,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1058,6 +1061,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1080,6 +1084,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json
index 6d7249836..44d4a173f 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json
@@ -613,6 +613,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -766,6 +767,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -919,6 +921,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -941,6 +944,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.json
index 119e5633d..7322bc54b 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.json
@@ -142,6 +142,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -161,6 +162,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -180,6 +182,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -199,6 +202,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -218,6 +222,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.json
index 6df5dbf2b..168c09f86 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.json
@@ -278,6 +278,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -303,6 +304,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -328,6 +330,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -353,6 +356,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -378,6 +382,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.json
index b61454e00..7a67324f5 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.json
@@ -769,6 +769,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -928,6 +929,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1087,6 +1089,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1115,6 +1118,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1143,6 +1147,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.json
index 8e019bd84..9bf028960 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.json
@@ -738,6 +738,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [
@@ -889,6 +890,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [
@@ -1040,6 +1042,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
@@ -1060,6 +1063,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
@@ -1080,6 +1084,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-options.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-options.json
index 119e5633d..7322bc54b 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-options.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-options.json
@@ -142,6 +142,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -161,6 +162,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -180,6 +182,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -199,6 +202,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -218,6 +222,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.json
index bf84ee743..e8fa4cbe1 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.json
@@ -187,6 +187,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -210,6 +211,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -233,6 +235,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -256,6 +259,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -279,6 +283,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
                 "local_context_data": [
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json
index 22f9d4e5f..7e414dce5 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json
@@ -790,6 +790,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -950,6 +951,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1110,6 +1112,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1139,6 +1142,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1168,6 +1172,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory.json b/tests/integration/targets/inventory-v3.7/files/test-inventory.json
index 360a7ac33..64478c218 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory.json
@@ -730,6 +730,7 @@
             },
             "test100-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "test100",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -883,6 +884,7 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1036,6 +1038,7 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1058,6 +1061,7 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
+                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1080,6 +1084,7 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},

From fb3cdc2468d642d2a6c2832791739f41fc7c858e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Wed, 14 Feb 2024 15:24:56 +0100
Subject: [PATCH 08/15] test to get integration tests in ok status

---
 plugins/inventory/nb_inventory.py                     |  3 +--
 .../inventory-v3.5/files/test-inventory-options.json  | 11 +++++++++++
 .../files/test-inventory-plurals-flatten.json         | 11 +++++++++++
 .../inventory-v3.5/files/test-inventory-plurals.json  |  8 ++++++++
 .../targets/inventory-v3.5/files/test-inventory.json  |  8 ++++++++
 5 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/plugins/inventory/nb_inventory.py b/plugins/inventory/nb_inventory.py
index 6c8ca958e..deec93e5c 100644
--- a/plugins/inventory/nb_inventory.py
+++ b/plugins/inventory/nb_inventory.py
@@ -948,8 +948,7 @@ def extract_cluster_device(self, host):
         # cluster device does not have a slug
         if host.get("device", None) is None:
             return ""
-        else:
-            return host.get("device", {"name": ""}).get("name", "")
+        return host.get("device", {"name": ""}).get("name", "")
 
     def extract_cluster_group(self, host):
         try:
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-options.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-options.json
index 7322bc54b..c7e1cc200 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-options.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-options.json
@@ -1,6 +1,7 @@
 {
     "Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -27,6 +28,7 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
+                "cluster_device": "",
                 "custom_fields": {},
                 "device_type": "cisco-test",
                 "is_virtual": false,
@@ -48,6 +50,7 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
@@ -61,6 +64,7 @@
                 "tags": []
             },
             "TestDeviceR1": {
+                "cluster_device": "",
                 "custom_fields": {},
                 "device_type": "cisco-test",
                 "is_virtual": false,
@@ -87,6 +91,7 @@
             },
             "VC1": {
                 "ansible_host": "nexus.example.com",
+                "cluster_device": "",
                 "custom_fields": {},
                 "device_type": "nexus-parent",
                 "dns_name": "nexus.example.com",
@@ -113,6 +118,10 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "device_type": "cisco-test",
                 "is_virtual": false,
@@ -336,6 +345,7 @@
     },
     "test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -345,6 +355,7 @@
     "test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals-flatten.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals-flatten.json
index e8fa4cbe1..23d530990 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals-flatten.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals-flatten.json
@@ -1,6 +1,7 @@
 {
     "Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -27,6 +28,7 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
+                "cluster_device": "",
                 "device_roles": [
                     "core-switch"
                 ],
@@ -59,6 +61,7 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
+                "cluster_device": "",
                 "device_roles": [
                     "core-switch"
                 ],
@@ -94,6 +97,7 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
                 "local_context_data": [
@@ -109,6 +113,7 @@
                 "tags": []
             },
             "TestDeviceR1": {
+                "cluster_device": "",
                 "device_roles": [
                     "core-switch"
                 ],
@@ -146,6 +151,10 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "device_roles": [
                     "core-switch"
                 ],
@@ -392,6 +401,7 @@
     },
     "test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -401,6 +411,7 @@
     "test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json
index 7e414dce5..0061c4082 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json
@@ -3,6 +3,7 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
+                "cluster_device": "",
                 "config_context": [
                     {}
                 ],
@@ -41,6 +42,7 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
+                "cluster_device": "",
                 "config_context": [
                     {}
                 ],
@@ -324,6 +326,7 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
@@ -422,6 +425,7 @@
                 "tags": []
             },
             "TestDeviceR1": {
+                "cluster_device": "",
                 "config_context": [
                     {}
                 ],
@@ -465,6 +469,10 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "config_context": [
                     {
                         "ntp_servers": [
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory.json b/tests/integration/targets/inventory-v3.5/files/test-inventory.json
index 64478c218..73861008f 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory.json
@@ -3,6 +3,7 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
+                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "cisco-test",
@@ -26,6 +27,7 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
+                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "nexus-parent",
@@ -296,6 +298,7 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
@@ -389,6 +392,7 @@
                 "tags": []
             },
             "TestDeviceR1": {
+                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "cisco-test",
@@ -417,6 +421,10 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "config_context": {
                     "ntp_servers": [
                         "pool.ntp.org"

From b586d3fd6dd0b0cbf2769d12e28b8e5a87b1697a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Wed, 14 Feb 2024 16:49:21 +0100
Subject: [PATCH 09/15] test to get integration tests in ok status inventory
 v3.5

---
 .../inventory-v3.5/files/reference.json       | 1402 +++++++++++++++++
 .../files/test-inventory-bearer-token.json    |   51 +-
 .../files/test-inventory-jinja2-filter.json   |    9 +
 .../files/test-inventory-jinja2.json          |   11 +
 .../files/test-inventory-legacy.json          |    8 +
 .../files/test-inventory-noracks.json         |   51 +-
 .../files/test-inventory-options-flatten.json |   51 +-
 .../files/test-inventory-plurals.json         |   43 +-
 .../inventory-v3.5/files/test-inventory.json  |   29 +-
 9 files changed, 1562 insertions(+), 93 deletions(-)
 create mode 100644 tests/integration/targets/inventory-v3.5/files/reference.json

diff --git a/tests/integration/targets/inventory-v3.5/files/reference.json b/tests/integration/targets/inventory-v3.5/files/reference.json
new file mode 100644
index 000000000..e5a18b2a8
--- /dev/null
+++ b/tests/integration/targets/inventory-v3.5/files/reference.json
@@ -0,0 +1,1402 @@
+{
+    "_meta": {
+        "hostvars": {
+            "R1-Device": {
+                "asset_tag": "345678901",
+                "cluster_device": "",
+                "config_context": {},
+                "custom_fields": {},
+                "device_type": "cisco-test",
+                "interfaces": [],
+                "is_virtual": false,
+                "locations": [],
+                "manufacturer": "cisco",
+                "rack": "Test Rack Site 2",
+                "rack_role": "test-rack-role",
+                "regions": [],
+                "role": "core-switch",
+                "serial": "",
+                "services": [],
+                "site": "test-site2",
+                "site_groups": [],
+                "status": {
+                    "label": "Active",
+                    "value": "active"
+                },
+                "tags": []
+            },
+            "Test Nexus One": {
+                "ansible_host": "172.16.180.12",
+                "cluster_device": "",
+                "config_context": {},
+                "custom_fields": {},
+                "device_type": "nexus-parent",
+                "dns_name": "nexus.example.com",
+                "interfaces": [
+                    {
+                        "_occupied": false,
+                        "bridge": null,
+                        "cable": null,
+                        "cable_end": "",
+                        "connected_endpoints": null,
+                        "connected_endpoints_reachable": null,
+                        "connected_endpoints_type": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 1,
+                        "created": "2024-02-14T11:44:32.091746Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "device": {
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One",
+                            "url": "http://localhost:32768/api/dcim/devices/5/"
+                        },
+                        "display": "Ethernet2/1",
+                        "duplex": null,
+                        "enabled": true,
+                        "id": 2,
+                        "ip_addresses": [
+                            {
+                                "address": "172.16.180.12/24",
+                                "comments": "",
+                                "created": "2024-02-14T11:44:32.515127Z",
+                                "custom_fields": {},
+                                "description": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
+                                "family": {
+                                    "label": "IPv4",
+                                    "value": 4
+                                },
+                                "id": 4,
+                                "last_updated": "2024-02-14T11:44:32.515133Z",
+                                "nat_inside": null,
+                                "nat_outside": [],
+                                "role": null,
+                                "status": {
+                                    "label": "Active",
+                                    "value": "active"
+                                },
+                                "tags": [],
+                                "tenant": null,
+                                "url": "http://localhost:32768/api/ipam/ip-addresses/4/",
+                                "vrf": null
+                            }
+                        ],
+                        "l2vpn_termination": null,
+                        "label": "",
+                        "lag": null,
+                        "last_updated": "2024-02-14T11:44:32.091756Z",
+                        "link_peers": [],
+                        "link_peers_type": null,
+                        "mac_address": null,
+                        "mark_connected": false,
+                        "mgmt_only": false,
+                        "mode": null,
+                        "module": null,
+                        "mtu": null,
+                        "name": "Ethernet2/1",
+                        "parent": null,
+                        "poe_mode": null,
+                        "poe_type": null,
+                        "rf_channel": null,
+                        "rf_channel_frequency": null,
+                        "rf_channel_width": null,
+                        "rf_role": null,
+                        "speed": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "tx_power": null,
+                        "type": {
+                            "label": "1000BASE-T (1GE)",
+                            "value": "1000base-t"
+                        },
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/dcim/interfaces/2/",
+                        "vdcs": [],
+                        "vrf": null,
+                        "wireless_lans": [],
+                        "wireless_link": null,
+                        "wwn": null
+                    },
+                    {
+                        "_occupied": false,
+                        "bridge": null,
+                        "cable": null,
+                        "cable_end": "",
+                        "connected_endpoints": null,
+                        "connected_endpoints_reachable": null,
+                        "connected_endpoints_type": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 1,
+                        "created": "2024-02-14T11:44:32.060428Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "device": {
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One",
+                            "url": "http://localhost:32768/api/dcim/devices/4/"
+                        },
+                        "display": "Ethernet1/1",
+                        "duplex": null,
+                        "enabled": true,
+                        "id": 1,
+                        "ip_addresses": [
+                            {
+                                "address": "172.16.180.11/24",
+                                "comments": "",
+                                "created": "2024-02-14T11:44:32.505456Z",
+                                "custom_fields": {},
+                                "description": "",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
+                                "family": {
+                                    "label": "IPv4",
+                                    "value": 4
+                                },
+                                "id": 3,
+                                "last_updated": "2024-02-14T11:44:32.505462Z",
+                                "nat_inside": null,
+                                "nat_outside": [],
+                                "role": null,
+                                "status": {
+                                    "label": "Active",
+                                    "value": "active"
+                                },
+                                "tags": [],
+                                "tenant": null,
+                                "url": "http://localhost:32768/api/ipam/ip-addresses/3/",
+                                "vrf": null
+                            }
+                        ],
+                        "l2vpn_termination": null,
+                        "label": "",
+                        "lag": null,
+                        "last_updated": "2024-02-14T11:44:32.060441Z",
+                        "link_peers": [],
+                        "link_peers_type": null,
+                        "mac_address": null,
+                        "mark_connected": false,
+                        "mgmt_only": false,
+                        "mode": null,
+                        "module": null,
+                        "mtu": null,
+                        "name": "Ethernet1/1",
+                        "parent": null,
+                        "poe_mode": null,
+                        "poe_type": null,
+                        "rf_channel": null,
+                        "rf_channel_frequency": null,
+                        "rf_channel_width": null,
+                        "rf_role": null,
+                        "speed": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "tx_power": null,
+                        "type": {
+                            "label": "1000BASE-T (1GE)",
+                            "value": "1000base-t"
+                        },
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/dcim/interfaces/1/",
+                        "vdcs": [],
+                        "vrf": null,
+                        "wireless_lans": [],
+                        "wireless_link": null,
+                        "wwn": null
+                    },
+                    {
+                        "_occupied": false,
+                        "bridge": null,
+                        "cable": null,
+                        "cable_end": "",
+                        "connected_endpoints": null,
+                        "connected_endpoints_reachable": null,
+                        "connected_endpoints_type": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:32.232803Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "device": {
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One",
+                            "url": "http://localhost:32768/api/dcim/devices/4/"
+                        },
+                        "display": "wlink1",
+                        "duplex": null,
+                        "enabled": true,
+                        "id": 6,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "label": "",
+                        "lag": null,
+                        "last_updated": "2024-02-14T11:44:32.232813Z",
+                        "link_peers": [],
+                        "link_peers_type": null,
+                        "mac_address": null,
+                        "mark_connected": false,
+                        "mgmt_only": false,
+                        "mode": null,
+                        "module": null,
+                        "mtu": null,
+                        "name": "wlink1",
+                        "parent": null,
+                        "poe_mode": null,
+                        "poe_type": null,
+                        "rf_channel": null,
+                        "rf_channel_frequency": null,
+                        "rf_channel_width": null,
+                        "rf_role": null,
+                        "speed": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "tx_power": null,
+                        "type": {
+                            "label": "IEEE 802.11a",
+                            "value": "ieee802.11a"
+                        },
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/dcim/interfaces/6/",
+                        "vdcs": [],
+                        "vrf": null,
+                        "wireless_lans": [],
+                        "wireless_link": null,
+                        "wwn": null
+                    }
+                ],
+                "is_virtual": false,
+                "locations": [
+                    "test-rack-group",
+                    "parent-rack-group"
+                ],
+                "manufacturer": "cisco",
+                "primary_ip4": "172.16.180.12",
+                "regions": [
+                    "test-region",
+                    "parent-region"
+                ],
+                "role": "core-switch",
+                "serial": "",
+                "services": [
+                    {
+                        "comments": "",
+                        "created": "2024-02-14T11:44:33.208305Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "device": {
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One",
+                            "url": "http://localhost:32768/api/dcim/devices/4/"
+                        },
+                        "display": "telnet (TCP/23)",
+                        "id": 3,
+                        "ipaddresses": [],
+                        "last_updated": "2024-02-14T11:44:33.208311Z",
+                        "name": "telnet",
+                        "ports": [
+                            23
+                        ],
+                        "protocol": {
+                            "label": "TCP",
+                            "value": "tcp"
+                        },
+                        "tags": [],
+                        "url": "http://localhost:32768/api/ipam/services/3/",
+                        "virtual_machine": null
+                    }
+                ],
+                "site": "test-site",
+                "site_groups": [],
+                "status": {
+                    "label": "Active",
+                    "value": "active"
+                },
+                "tags": []
+            },
+            "Test VM With Spaces": {
+                "cluster": "Test Cluster 2",
+                "cluster_device": "",
+                "cluster_type": "test-cluster-type",
+                "config_context": {},
+                "custom_fields": {},
+                "interfaces": [
+                    {
+                        "bridge": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:33.086508Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "display": "Eth0",
+                        "enabled": true,
+                        "id": 11,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "last_updated": "2024-02-14T11:44:33.086515Z",
+                        "mac_address": null,
+                        "mode": null,
+                        "mtu": null,
+                        "name": "Eth0",
+                        "parent": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/virtualization/interfaces/11/",
+                        "virtual_machine": {
+                            "display": "Test VM With Spaces",
+                            "id": 6,
+                            "name": "Test VM With Spaces",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/6/"
+                        },
+                        "vrf": null
+                    },
+                    {
+                        "bridge": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:33.096917Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "display": "Eth1",
+                        "enabled": true,
+                        "id": 12,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "last_updated": "2024-02-14T11:44:33.096924Z",
+                        "mac_address": null,
+                        "mode": null,
+                        "mtu": null,
+                        "name": "Eth1",
+                        "parent": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/virtualization/interfaces/12/",
+                        "virtual_machine": {
+                            "display": "Test VM With Spaces",
+                            "id": 6,
+                            "name": "Test VM With Spaces",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/6/"
+                        },
+                        "vrf": null
+                    }
+                ],
+                "is_virtual": true,
+                "locations": [],
+                "regions": [],
+                "services": [
+                    {
+                        "comments": "",
+                        "created": "2024-02-14T11:44:33.215473Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "device": null,
+                        "display": "ssh (TCP/22)",
+                        "id": 4,
+                        "ipaddresses": [],
+                        "last_updated": "2024-02-14T11:44:33.215478Z",
+                        "name": "ssh",
+                        "ports": [
+                            22
+                        ],
+                        "protocol": {
+                            "label": "TCP",
+                            "value": "tcp"
+                        },
+                        "tags": [],
+                        "url": "http://localhost:32768/api/ipam/services/4/",
+                        "virtual_machine": {
+                            "display": "Test VM With Spaces",
+                            "id": 6,
+                            "name": "Test VM With Spaces",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/6/"
+                        }
+                    }
+                ],
+                "site_groups": [],
+                "status": {
+                    "label": "Active",
+                    "value": "active"
+                },
+                "tags": []
+            },
+            "TestDeviceR1": {
+                "cluster_device": "",
+                "config_context": {},
+                "custom_fields": {},
+                "device_type": "cisco-test",
+                "interfaces": [],
+                "is_virtual": false,
+                "locations": [
+                    "test-rack-group",
+                    "parent-rack-group"
+                ],
+                "manufacturer": "cisco",
+                "rack": "Test Rack",
+                "regions": [
+                    "test-region",
+                    "parent-region"
+                ],
+                "role": "core-switch",
+                "serial": "FAB12345678",
+                "services": [],
+                "site": "test-site",
+                "site_groups": [],
+                "status": {
+                    "label": "Active",
+                    "value": "active"
+                },
+                "tags": []
+            },
+            "test100": {
+                "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
+                "config_context": {
+                    "ntp_servers": [
+                        "pool.ntp.org"
+                    ]
+                },
+                "custom_fields": {},
+                "device_type": "cisco-test",
+                "interfaces": [
+                    {
+                        "_occupied": false,
+                        "bridge": null,
+                        "cable": null,
+                        "cable_end": "",
+                        "connected_endpoints": null,
+                        "connected_endpoints_reachable": null,
+                        "connected_endpoints_type": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 1,
+                        "created": "2024-02-14T11:44:32.149514Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "device": {
+                            "display": "test100 (123456789)",
+                            "id": 1,
+                            "name": "test100",
+                            "url": "http://localhost:32768/api/dcim/devices/1/"
+                        },
+                        "display": "GigabitEthernet1",
+                        "duplex": null,
+                        "enabled": true,
+                        "id": 3,
+                        "ip_addresses": [
+                            {
+                                "address": "172.16.180.1/24",
+                                "comments": "",
+                                "created": "2024-02-14T11:44:32.484105Z",
+                                "custom_fields": {},
+                                "description": "",
+                                "display": "172.16.180.1/24",
+                                "dns_name": "",
+                                "family": {
+                                    "label": "IPv4",
+                                    "value": 4
+                                },
+                                "id": 1,
+                                "last_updated": "2024-02-14T11:44:32.484118Z",
+                                "nat_inside": null,
+                                "nat_outside": [],
+                                "role": null,
+                                "status": {
+                                    "label": "Active",
+                                    "value": "active"
+                                },
+                                "tags": [],
+                                "tenant": null,
+                                "url": "http://localhost:32768/api/ipam/ip-addresses/1/",
+                                "vrf": null
+                            }
+                        ],
+                        "l2vpn_termination": null,
+                        "label": "",
+                        "lag": null,
+                        "last_updated": "2024-02-14T11:44:32.149526Z",
+                        "link_peers": [],
+                        "link_peers_type": null,
+                        "mac_address": null,
+                        "mark_connected": false,
+                        "mgmt_only": false,
+                        "mode": null,
+                        "module": null,
+                        "mtu": null,
+                        "name": "GigabitEthernet1",
+                        "parent": null,
+                        "poe_mode": null,
+                        "poe_type": null,
+                        "rf_channel": null,
+                        "rf_channel_frequency": null,
+                        "rf_channel_width": null,
+                        "rf_role": null,
+                        "speed": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "tx_power": null,
+                        "type": {
+                            "label": "1000BASE-T (1GE)",
+                            "value": "1000base-t"
+                        },
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/dcim/interfaces/3/",
+                        "vdcs": [],
+                        "vrf": null,
+                        "wireless_lans": [],
+                        "wireless_link": null,
+                        "wwn": null
+                    },
+                    {
+                        "_occupied": false,
+                        "bridge": null,
+                        "cable": null,
+                        "cable_end": "",
+                        "connected_endpoints": null,
+                        "connected_endpoints_reachable": null,
+                        "connected_endpoints_type": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 1,
+                        "created": "2024-02-14T11:44:32.168795Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "device": {
+                            "display": "test100 (123456789)",
+                            "id": 1,
+                            "name": "test100",
+                            "url": "http://localhost:32768/api/dcim/devices/1/"
+                        },
+                        "display": "GigabitEthernet2",
+                        "duplex": null,
+                        "enabled": true,
+                        "id": 4,
+                        "ip_addresses": [
+                            {
+                                "address": "2001::1:1/64",
+                                "comments": "",
+                                "created": "2024-02-14T11:44:32.494861Z",
+                                "custom_fields": {},
+                                "description": "",
+                                "display": "2001::1:1/64",
+                                "dns_name": "",
+                                "family": {
+                                    "label": "IPv6",
+                                    "value": 6
+                                },
+                                "id": 2,
+                                "last_updated": "2024-02-14T11:44:32.494868Z",
+                                "nat_inside": null,
+                                "nat_outside": [],
+                                "role": null,
+                                "status": {
+                                    "label": "Active",
+                                    "value": "active"
+                                },
+                                "tags": [],
+                                "tenant": null,
+                                "url": "http://localhost:32768/api/ipam/ip-addresses/2/",
+                                "vrf": null
+                            }
+                        ],
+                        "l2vpn_termination": null,
+                        "label": "",
+                        "lag": null,
+                        "last_updated": "2024-02-14T11:44:32.168802Z",
+                        "link_peers": [],
+                        "link_peers_type": null,
+                        "mac_address": null,
+                        "mark_connected": false,
+                        "mgmt_only": false,
+                        "mode": null,
+                        "module": null,
+                        "mtu": null,
+                        "name": "GigabitEthernet2",
+                        "parent": null,
+                        "poe_mode": null,
+                        "poe_type": null,
+                        "rf_channel": null,
+                        "rf_channel_frequency": null,
+                        "rf_channel_width": null,
+                        "rf_role": null,
+                        "speed": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "tx_power": null,
+                        "type": {
+                            "label": "1000BASE-T (1GE)",
+                            "value": "1000base-t"
+                        },
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/dcim/interfaces/4/",
+                        "vdcs": [],
+                        "vrf": null,
+                        "wireless_lans": [],
+                        "wireless_link": null,
+                        "wwn": null
+                    },
+                    {
+                        "_occupied": false,
+                        "bridge": null,
+                        "cable": null,
+                        "cable_end": "",
+                        "connected_endpoints": null,
+                        "connected_endpoints_reachable": null,
+                        "connected_endpoints_type": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:32.211879Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "device": {
+                            "display": "test100 (123456789)",
+                            "id": 1,
+                            "name": "test100",
+                            "url": "http://localhost:32768/api/dcim/devices/1/"
+                        },
+                        "display": "wlink1",
+                        "duplex": null,
+                        "enabled": true,
+                        "id": 5,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "label": "",
+                        "lag": null,
+                        "last_updated": "2024-02-14T11:44:32.211888Z",
+                        "link_peers": [],
+                        "link_peers_type": null,
+                        "mac_address": null,
+                        "mark_connected": false,
+                        "mgmt_only": false,
+                        "mode": null,
+                        "module": null,
+                        "mtu": null,
+                        "name": "wlink1",
+                        "parent": null,
+                        "poe_mode": null,
+                        "poe_type": null,
+                        "rf_channel": null,
+                        "rf_channel_frequency": null,
+                        "rf_channel_width": null,
+                        "rf_role": null,
+                        "speed": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "tx_power": null,
+                        "type": {
+                            "label": "IEEE 802.11a",
+                            "value": "ieee802.11a"
+                        },
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/dcim/interfaces/5/",
+                        "vdcs": [],
+                        "vrf": null,
+                        "wireless_lans": [],
+                        "wireless_link": null,
+                        "wwn": null
+                    }
+                ],
+                "is_virtual": false,
+                "local_context_data": {
+                    "ntp_servers": [
+                        "pool.ntp.org"
+                    ]
+                },
+                "locations": [
+                    "test-rack-group",
+                    "parent-rack-group"
+                ],
+                "manufacturer": "cisco",
+                "regions": [
+                    "test-region",
+                    "parent-region"
+                ],
+                "role": "core-switch",
+                "serial": "FAB01234567",
+                "services": [
+                    {
+                        "comments": "",
+                        "created": "2024-02-14T11:44:33.180356Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "device": {
+                            "display": "test100 (123456789)",
+                            "id": 1,
+                            "name": "test100",
+                            "url": "http://localhost:32768/api/dcim/devices/1/"
+                        },
+                        "display": "ssh (TCP/22)",
+                        "id": 1,
+                        "ipaddresses": [],
+                        "last_updated": "2024-02-14T11:44:33.180363Z",
+                        "name": "ssh",
+                        "ports": [
+                            22
+                        ],
+                        "protocol": {
+                            "label": "TCP",
+                            "value": "tcp"
+                        },
+                        "tags": [],
+                        "url": "http://localhost:32768/api/ipam/services/1/",
+                        "virtual_machine": null
+                    },
+                    {
+                        "comments": "",
+                        "created": "2024-02-14T11:44:33.189722Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "device": {
+                            "display": "test100 (123456789)",
+                            "id": 1,
+                            "name": "test100",
+                            "url": "http://localhost:32768/api/dcim/devices/1/"
+                        },
+                        "display": "http (TCP/80)",
+                        "id": 2,
+                        "ipaddresses": [
+                            {
+                                "address": "172.16.180.1/24",
+                                "display": "172.16.180.1/24",
+                                "family": 4,
+                                "id": 1,
+                                "url": "http://localhost:32768/api/ipam/ip-addresses/1/"
+                            },
+                            {
+                                "address": "2001::1:1/64",
+                                "display": "2001::1:1/64",
+                                "family": 6,
+                                "id": 2,
+                                "url": "http://localhost:32768/api/ipam/ip-addresses/2/"
+                            }
+                        ],
+                        "last_updated": "2024-02-14T11:44:33.189727Z",
+                        "name": "http",
+                        "ports": [
+                            80
+                        ],
+                        "protocol": {
+                            "label": "TCP",
+                            "value": "tcp"
+                        },
+                        "tags": [],
+                        "url": "http://localhost:32768/api/ipam/services/2/",
+                        "virtual_machine": null
+                    }
+                ],
+                "site": "test-site",
+                "site_groups": [],
+                "status": {
+                    "label": "Active",
+                    "value": "active"
+                },
+                "tags": []
+            },
+            "test100-vm": {
+                "cluster": "Test Cluster",
+                "cluster_device": "test100",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
+                "config_context": {},
+                "custom_fields": {},
+                "interfaces": [
+                    {
+                        "bridge": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:32.977245Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "display": "Eth0",
+                        "enabled": true,
+                        "id": 1,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "last_updated": "2024-02-14T11:44:32.977256Z",
+                        "mac_address": null,
+                        "mode": null,
+                        "mtu": null,
+                        "name": "Eth0",
+                        "parent": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/virtualization/interfaces/1/",
+                        "virtual_machine": {
+                            "display": "test100-vm",
+                            "id": 1,
+                            "name": "test100-vm",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/1/"
+                        },
+                        "vrf": null
+                    },
+                    {
+                        "bridge": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:32.993554Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "display": "Eth1",
+                        "enabled": true,
+                        "id": 2,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "last_updated": "2024-02-14T11:44:32.993560Z",
+                        "mac_address": null,
+                        "mode": null,
+                        "mtu": null,
+                        "name": "Eth1",
+                        "parent": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/virtualization/interfaces/2/",
+                        "virtual_machine": {
+                            "display": "test100-vm",
+                            "id": 1,
+                            "name": "test100-vm",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/1/"
+                        },
+                        "vrf": null
+                    },
+                    {
+                        "bridge": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:33.003972Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "display": "Eth2",
+                        "enabled": true,
+                        "id": 3,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "last_updated": "2024-02-14T11:44:33.003978Z",
+                        "mac_address": null,
+                        "mode": null,
+                        "mtu": null,
+                        "name": "Eth2",
+                        "parent": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/virtualization/interfaces/3/",
+                        "virtual_machine": {
+                            "display": "test100-vm",
+                            "id": 1,
+                            "name": "test100-vm",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/1/"
+                        },
+                        "vrf": null
+                    },
+                    {
+                        "bridge": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:33.015262Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "display": "Eth3",
+                        "enabled": true,
+                        "id": 4,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "last_updated": "2024-02-14T11:44:33.015268Z",
+                        "mac_address": null,
+                        "mode": null,
+                        "mtu": null,
+                        "name": "Eth3",
+                        "parent": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/virtualization/interfaces/4/",
+                        "virtual_machine": {
+                            "display": "test100-vm",
+                            "id": 1,
+                            "name": "test100-vm",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/1/"
+                        },
+                        "vrf": null
+                    },
+                    {
+                        "bridge": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:33.025273Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "display": "Eth4",
+                        "enabled": true,
+                        "id": 5,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "last_updated": "2024-02-14T11:44:33.025279Z",
+                        "mac_address": null,
+                        "mode": null,
+                        "mtu": null,
+                        "name": "Eth4",
+                        "parent": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/virtualization/interfaces/5/",
+                        "virtual_machine": {
+                            "display": "test100-vm",
+                            "id": 1,
+                            "name": "test100-vm",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/1/"
+                        },
+                        "vrf": null
+                    }
+                ],
+                "is_virtual": true,
+                "locations": [],
+                "regions": [
+                    "test-region",
+                    "parent-region"
+                ],
+                "services": [],
+                "site": "test-site",
+                "site_groups": [],
+                "status": {
+                    "label": "Active",
+                    "value": "active"
+                },
+                "tags": []
+            },
+            "test101-vm": {
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
+                "config_context": {},
+                "custom_fields": {},
+                "interfaces": [
+                    {
+                        "bridge": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:33.035047Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "display": "Eth0",
+                        "enabled": true,
+                        "id": 6,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "last_updated": "2024-02-14T11:44:33.035053Z",
+                        "mac_address": null,
+                        "mode": null,
+                        "mtu": null,
+                        "name": "Eth0",
+                        "parent": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/virtualization/interfaces/6/",
+                        "virtual_machine": {
+                            "display": "test101-vm",
+                            "id": 2,
+                            "name": "test101-vm",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/2/"
+                        },
+                        "vrf": null
+                    },
+                    {
+                        "bridge": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:33.045622Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "display": "Eth1",
+                        "enabled": true,
+                        "id": 7,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "last_updated": "2024-02-14T11:44:33.045628Z",
+                        "mac_address": null,
+                        "mode": null,
+                        "mtu": null,
+                        "name": "Eth1",
+                        "parent": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/virtualization/interfaces/7/",
+                        "virtual_machine": {
+                            "display": "test101-vm",
+                            "id": 2,
+                            "name": "test101-vm",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/2/"
+                        },
+                        "vrf": null
+                    },
+                    {
+                        "bridge": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:33.056509Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "display": "Eth2",
+                        "enabled": true,
+                        "id": 8,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "last_updated": "2024-02-14T11:44:33.056515Z",
+                        "mac_address": null,
+                        "mode": null,
+                        "mtu": null,
+                        "name": "Eth2",
+                        "parent": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/virtualization/interfaces/8/",
+                        "virtual_machine": {
+                            "display": "test101-vm",
+                            "id": 2,
+                            "name": "test101-vm",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/2/"
+                        },
+                        "vrf": null
+                    },
+                    {
+                        "bridge": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:33.066290Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "display": "Eth3",
+                        "enabled": true,
+                        "id": 9,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "last_updated": "2024-02-14T11:44:33.066295Z",
+                        "mac_address": null,
+                        "mode": null,
+                        "mtu": null,
+                        "name": "Eth3",
+                        "parent": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/virtualization/interfaces/9/",
+                        "virtual_machine": {
+                            "display": "test101-vm",
+                            "id": 2,
+                            "name": "test101-vm",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/2/"
+                        },
+                        "vrf": null
+                    },
+                    {
+                        "bridge": null,
+                        "count_fhrp_groups": 0,
+                        "count_ipaddresses": 0,
+                        "created": "2024-02-14T11:44:33.076048Z",
+                        "custom_fields": {},
+                        "description": "",
+                        "display": "Eth4",
+                        "enabled": true,
+                        "id": 10,
+                        "ip_addresses": [],
+                        "l2vpn_termination": null,
+                        "last_updated": "2024-02-14T11:44:33.076054Z",
+                        "mac_address": null,
+                        "mode": null,
+                        "mtu": null,
+                        "name": "Eth4",
+                        "parent": null,
+                        "tagged_vlans": [],
+                        "tags": [],
+                        "untagged_vlan": null,
+                        "url": "http://localhost:32768/api/virtualization/interfaces/10/",
+                        "virtual_machine": {
+                            "display": "test101-vm",
+                            "id": 2,
+                            "name": "test101-vm",
+                            "url": "http://localhost:32768/api/virtualization/virtual-machines/2/"
+                        },
+                        "vrf": null
+                    }
+                ],
+                "is_virtual": true,
+                "locations": [],
+                "regions": [
+                    "test-region",
+                    "parent-region"
+                ],
+                "services": [],
+                "site": "test-site",
+                "site_groups": [],
+                "status": {
+                    "label": "Active",
+                    "value": "active"
+                },
+                "tags": []
+            },
+            "test102-vm": {
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
+                "config_context": {},
+                "custom_fields": {},
+                "interfaces": [],
+                "is_virtual": true,
+                "locations": [],
+                "regions": [
+                    "test-region",
+                    "parent-region"
+                ],
+                "services": [],
+                "site": "test-site",
+                "site_groups": [],
+                "status": {
+                    "label": "Active",
+                    "value": "active"
+                },
+                "tags": []
+            },
+            "test103-vm": {
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
+                "config_context": {},
+                "custom_fields": {},
+                "interfaces": [],
+                "is_virtual": true,
+                "locations": [],
+                "regions": [
+                    "test-region",
+                    "parent-region"
+                ],
+                "services": [],
+                "site": "test-site",
+                "site_groups": [],
+                "status": {
+                    "label": "Active",
+                    "value": "active"
+                },
+                "tags": []
+            },
+            "test104-vm": {
+                "cluster": "Test Cluster 2",
+                "cluster_device": "",
+                "cluster_type": "test-cluster-type",
+                "config_context": {},
+                "custom_fields": {},
+                "interfaces": [],
+                "is_virtual": true,
+                "locations": [],
+                "regions": [],
+                "services": [],
+                "site_groups": [],
+                "status": {
+                    "label": "Active",
+                    "value": "active"
+                },
+                "tags": []
+            }
+        }
+    },
+    "all": {
+        "children": [
+            "cluster_Test_Cluster",
+            "cluster_Test_Cluster_2",
+            "cluster_group_test_cluster_group",
+            "cluster_type_test_cluster_type",
+            "device_type_cisco_test",
+            "device_type_nexus_parent",
+            "is_virtual",
+            "manufacturer_cisco",
+            "rack_Test_Rack",
+            "rack_Test_Rack_Site_2",
+            "rack_role_test_rack_role",
+            "region_other_region",
+            "region_parent_region",
+            "role_core_switch",
+            "service_http",
+            "service_ssh",
+            "service_telnet",
+            "site_group_other_site_group",
+            "site_group_parent_site_group",
+            "site_test_site2",
+            "status_active",
+            "ungrouped"
+        ]
+    },
+    "cluster_Test_Cluster": {
+        "hosts": [
+            "test100",
+            "test100-vm",
+            "test101-vm",
+            "test102-vm",
+            "test103-vm"
+        ]
+    },
+    "cluster_Test_Cluster_2": {
+        "hosts": [
+            "Test VM With Spaces",
+            "test104-vm"
+        ]
+    },
+    "cluster_group_test_cluster_group": {
+        "hosts": [
+            "test100",
+            "test100-vm",
+            "test101-vm",
+            "test102-vm",
+            "test103-vm"
+        ]
+    },
+    "cluster_type_test_cluster_type": {
+        "hosts": [
+            "Test VM With Spaces",
+            "test100",
+            "test100-vm",
+            "test101-vm",
+            "test102-vm",
+            "test103-vm",
+            "test104-vm"
+        ]
+    },
+    "device_type_cisco_test": {
+        "hosts": [
+            "R1-Device",
+            "TestDeviceR1",
+            "test100"
+        ]
+    },
+    "device_type_nexus_parent": {
+        "hosts": [
+            "Test Nexus One"
+        ]
+    },
+    "is_virtual": {
+        "hosts": [
+            "Test VM With Spaces",
+            "test100-vm",
+            "test101-vm",
+            "test102-vm",
+            "test103-vm",
+            "test104-vm"
+        ]
+    },
+    "location_parent_rack_group": {
+        "children": [
+            "location_test_rack_group"
+        ]
+    },
+    "location_test_rack_group": {
+        "hosts": [
+            "Test Nexus One",
+            "TestDeviceR1",
+            "test100"
+        ]
+    },
+    "manufacturer_cisco": {
+        "hosts": [
+            "R1-Device",
+            "Test Nexus One",
+            "TestDeviceR1",
+            "test100"
+        ]
+    },
+    "rack_Test_Rack": {
+        "hosts": [
+            "TestDeviceR1"
+        ]
+    },
+    "rack_Test_Rack_Site_2": {
+        "hosts": [
+            "R1-Device"
+        ]
+    },
+    "rack_role_test_rack_role": {
+        "hosts": [
+            "R1-Device"
+        ]
+    },
+    "region_parent_region": {
+        "children": [
+            "region_test_region"
+        ]
+    },
+    "region_test_region": {
+        "children": [
+            "site_test_site"
+        ]
+    },
+    "role_core_switch": {
+        "hosts": [
+            "R1-Device",
+            "Test Nexus One",
+            "TestDeviceR1",
+            "test100"
+        ]
+    },
+    "service_http": {
+        "hosts": [
+            "test100"
+        ]
+    },
+    "service_ssh": {
+        "hosts": [
+            "Test VM With Spaces",
+            "test100"
+        ]
+    },
+    "service_telnet": {
+        "hosts": [
+            "Test Nexus One"
+        ]
+    },
+    "site_group_parent_site_group": {
+        "children": [
+            "site_group_test_site_group"
+        ]
+    },
+    "site_test_site": {
+        "children": [
+            "location_parent_rack_group"
+        ],
+        "hosts": [
+            "test100-vm",
+            "test101-vm",
+            "test102-vm",
+            "test103-vm"
+        ]
+    },
+    "site_test_site2": {
+        "hosts": [
+            "R1-Device"
+        ]
+    },
+    "status_active": {
+        "hosts": [
+            "R1-Device",
+            "Test Nexus One",
+            "Test VM With Spaces",
+            "TestDeviceR1",
+            "test100",
+            "test100-vm",
+            "test101-vm",
+            "test102-vm",
+            "test103-vm",
+            "test104-vm"
+        ]
+    }
+}
\ No newline at end of file
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json
index 64478c218..768b7787c 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json
@@ -3,6 +3,7 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
+                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "cisco-test",
@@ -26,6 +27,7 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
+                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "nexus-parent",
@@ -44,27 +46,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -88,7 +90,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -124,27 +126,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -168,7 +170,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -296,6 +298,7 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
@@ -389,6 +392,7 @@
                 "tags": []
             },
             "TestDeviceR1": {
+                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "cisco-test",
@@ -417,6 +421,10 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "config_context": {
                     "ntp_servers": [
                         "pool.ntp.org"
@@ -1130,6 +1138,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1144,6 +1153,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1153,6 +1163,7 @@
     "cluster_type_test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json
index 44d4a173f..0e55477b1 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json
@@ -3,6 +3,7 @@
         "hostvars": {
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
+                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "nexus-parent",
@@ -272,6 +273,7 @@
                 "tags": []
             },
             "TestDeviceR1": {
+                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "cisco-test",
@@ -300,6 +302,10 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "config_context": {
                     "ntp_servers": [
                         "pool.ntp.org"
@@ -992,6 +998,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1000,6 +1007,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1008,6 +1016,7 @@
     },
     "cluster_type_test_cluster_type": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2.json
index 7322bc54b..c7e1cc200 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2.json
@@ -1,6 +1,7 @@
 {
     "Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -27,6 +28,7 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
+                "cluster_device": "",
                 "custom_fields": {},
                 "device_type": "cisco-test",
                 "is_virtual": false,
@@ -48,6 +50,7 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
@@ -61,6 +64,7 @@
                 "tags": []
             },
             "TestDeviceR1": {
+                "cluster_device": "",
                 "custom_fields": {},
                 "device_type": "cisco-test",
                 "is_virtual": false,
@@ -87,6 +91,7 @@
             },
             "VC1": {
                 "ansible_host": "nexus.example.com",
+                "cluster_device": "",
                 "custom_fields": {},
                 "device_type": "nexus-parent",
                 "dns_name": "nexus.example.com",
@@ -113,6 +118,10 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "device_type": "cisco-test",
                 "is_virtual": false,
@@ -336,6 +345,7 @@
     },
     "test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -345,6 +355,7 @@
     "test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-legacy.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-legacy.json
index 168c09f86..ae5166fb4 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-legacy.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-legacy.json
@@ -3,6 +3,7 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
+                "cluster_device": "",
                 "custom_fields": {},
                 "device_roles": [
                     "core-switch"
@@ -37,6 +38,7 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
+                "cluster_device": "",
                 "custom_fields": {},
                 "device_roles": [
                     "core-switch"
@@ -98,6 +100,7 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
@@ -139,6 +142,7 @@
                 "tags": []
             },
             "TestDeviceR1": {
+                "cluster_device": "",
                 "custom_fields": {},
                 "device_roles": [
                     "core-switch"
@@ -178,6 +182,10 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "device_roles": [
                     "core-switch"
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-noracks.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-noracks.json
index 7a67324f5..941dd3794 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-noracks.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-noracks.json
@@ -3,6 +3,7 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
+                "cluster_device": "",
                 "config_context": [
                     {}
                 ],
@@ -36,6 +37,7 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
+                "cluster_device": "",
                 "config_context": [
                     {}
                 ],
@@ -61,27 +63,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -105,7 +107,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -141,27 +143,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -185,7 +187,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -315,6 +317,7 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
@@ -412,6 +415,7 @@
                 "tags": []
             },
             "TestDeviceR1": {
+                "cluster_device": "",
                 "config_context": [
                     {}
                 ],
@@ -448,6 +452,10 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "config_context": [
                     {
                         "ntp_servers": [
@@ -1191,6 +1199,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1205,6 +1214,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1214,6 +1224,7 @@
     "cluster_type_test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-options-flatten.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-options-flatten.json
index 9bf028960..a104862d4 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-options-flatten.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-options-flatten.json
@@ -1,6 +1,7 @@
 {
     "Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -27,6 +28,7 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
+                "cluster_device": "",
                 "device_type": "cisco-test",
                 "interfaces": [],
                 "is_virtual": false,
@@ -48,6 +50,7 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
+                "cluster_device": "",
                 "device_type": "nexus-parent",
                 "dns_name": "nexus.example.com",
                 "interfaces": [
@@ -64,27 +67,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -108,7 +111,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -144,27 +147,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -188,7 +191,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -316,6 +319,7 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
+                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [
                     {
@@ -407,6 +411,7 @@
                 "tags": []
             },
             "TestDeviceR1": {
+                "cluster_device": "",
                 "device_type": "cisco-test",
                 "interfaces": [],
                 "is_virtual": false,
@@ -433,6 +438,10 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_device": "",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "device_type": "cisco-test",
                 "interfaces": [
                     {
@@ -1192,6 +1201,7 @@
     },
     "test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1201,6 +1211,7 @@
     "test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json
index 0061c4082..9c5d06d38 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json
@@ -68,27 +68,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -112,7 +112,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -148,27 +148,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -192,7 +192,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -1228,6 +1228,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1242,6 +1243,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1251,6 +1253,7 @@
     "cluster_type_test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory.json b/tests/integration/targets/inventory-v3.5/files/test-inventory.json
index 73861008f..d9cc88e0b 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory.json
@@ -60,8 +60,8 @@
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
@@ -90,7 +90,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -126,27 +126,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -170,7 +170,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -1138,6 +1138,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1152,6 +1153,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1161,6 +1163,7 @@
     "cluster_type_test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",

From 85dfed3d68876278ba4a73b33d7d406a0984be90 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Wed, 14 Feb 2024 17:09:45 +0100
Subject: [PATCH 10/15] fix inventory v3.5 inventory integration test

---
 .../inventory-v3.5/files/test-inventory.json       | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory.json b/tests/integration/targets/inventory-v3.5/files/test-inventory.json
index d9cc88e0b..768b7787c 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory.json
@@ -46,17 +46,17 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
@@ -66,7 +66,7 @@
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,

From e40418fecea813f48d08c92cbb18ec15230ce9ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Fri, 16 Feb 2024 10:14:32 +0100
Subject: [PATCH 11/15] approach to handle errors and at every error or missing
 value return a none type. if value is present return this value.

---
 plugins/inventory/nb_inventory.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/plugins/inventory/nb_inventory.py b/plugins/inventory/nb_inventory.py
index deec93e5c..e9ce3af23 100644
--- a/plugins/inventory/nb_inventory.py
+++ b/plugins/inventory/nb_inventory.py
@@ -945,10 +945,14 @@ def extract_cluster(self, host):
             return
 
     def extract_cluster_device(self, host):
-        # cluster device does not have a slug
-        if host.get("device", None) is None:
-            return ""
-        return host.get("device", {"name": ""}).get("name", "")
+        try:
+            # cluster device does not have a slug
+            if host.get("device") is None:
+                return
+            else:
+                return host["device"].get("name")
+        except TypeError:
+            return
 
     def extract_cluster_group(self, host):
         try:

From 66f1381c056dc88b19ea6410ae9e04c06b83d5dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Mon, 19 Feb 2024 10:28:53 +0100
Subject: [PATCH 12/15] align the integration tests to new implementation and
 featureset

---
 .../files/test-inventory-bearer-token.json    | 10 +---
 .../files/test-inventory-jinja2-filter.json   |  7 +--
 .../files/test-inventory-jinja2.json          |  9 ----
 .../files/test-inventory-legacy.json          |  9 ----
 .../files/test-inventory-noracks.json         |  9 ----
 .../files/test-inventory-options-flatten.json |  9 ----
 .../files/test-inventory-options.json         |  9 ----
 .../files/test-inventory-plurals-flatten.json |  9 ----
 .../files/test-inventory-plurals.json         |  9 ----
 .../inventory-v3.5/files/test-inventory.json  | 10 +---
 .../files/test-inventory-bearer-token.json    | 35 +++++++------
 .../files/test-inventory-jinja2-filter.json   |  4 +-
 .../files/test-inventory-jinja2.json          |  5 +-
 .../files/test-inventory-legacy.json          |  7 ++-
 .../files/test-inventory-noracks.json         | 50 +++++++++---------
 .../files/test-inventory-options-flatten.json | 47 +++++++++--------
 .../files/test-inventory-options.json         | 10 ++--
 .../files/test-inventory-plurals-flatten.json |  5 +-
 .../files/test-inventory-plurals.json         | 50 +++++++++---------
 .../inventory-v3.6/files/test-inventory.json  | 45 ++++++++--------
 .../files/reference.json                      |  9 ----
 .../files/test-inventory-bearer-token.json    | 42 +++++++--------
 .../files/test-inventory-jinja2-filter.json   |  4 +-
 .../files/test-inventory-jinja2.json          |  5 +-
 .../files/test-inventory-legacy.json          |  7 ++-
 .../files/test-inventory-noracks.json         | 50 +++++++++---------
 .../files/test-inventory-options-flatten.json | 46 ++++++++---------
 .../files/test-inventory-options.json         | 10 ++--
 .../files/test-inventory-plurals-flatten.json | 10 ++--
 .../files/test-inventory-plurals.json         | 48 ++++++++---------
 .../inventory-v3.7/files/test-inventory.json  | 51 ++++++++++---------
 31 files changed, 271 insertions(+), 359 deletions(-)
 rename tests/integration/targets/{inventory-v3.5 => inventory-v3.7}/files/reference.json (99%)

diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json
index 768b7787c..d3c47a788 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json
@@ -3,7 +3,6 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
-                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "cisco-test",
@@ -27,7 +26,6 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
-                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "nexus-parent",
@@ -298,7 +296,6 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
@@ -392,7 +389,6 @@
                 "tags": []
             },
             "TestDeviceR1": {
-                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "cisco-test",
@@ -422,7 +418,6 @@
             "test100": {
                 "asset_tag": "123456789",
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {
@@ -892,7 +887,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1046,7 +1040,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1069,7 +1062,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1092,7 +1084,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
@@ -1272,6 +1263,7 @@
             "location_parent_rack_group"
         ],
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json
index 0e55477b1..e16ac23d8 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json
@@ -3,7 +3,6 @@
         "hostvars": {
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
-                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "nexus-parent",
@@ -273,7 +272,6 @@
                 "tags": []
             },
             "TestDeviceR1": {
-                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "cisco-test",
@@ -303,7 +301,6 @@
             "test100": {
                 "asset_tag": "123456789",
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {
@@ -773,7 +770,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -927,7 +923,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -950,7 +945,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1108,6 +1102,7 @@
             "location_parent_rack_group"
         ],
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2.json
index c7e1cc200..a0bfd8b5e 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2.json
@@ -28,7 +28,6 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
-                "cluster_device": "",
                 "custom_fields": {},
                 "device_type": "cisco-test",
                 "is_virtual": false,
@@ -50,7 +49,6 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
@@ -64,7 +62,6 @@
                 "tags": []
             },
             "TestDeviceR1": {
-                "cluster_device": "",
                 "custom_fields": {},
                 "device_type": "cisco-test",
                 "is_virtual": false,
@@ -91,7 +88,6 @@
             },
             "VC1": {
                 "ansible_host": "nexus.example.com",
-                "cluster_device": "",
                 "custom_fields": {},
                 "device_type": "nexus-parent",
                 "dns_name": "nexus.example.com",
@@ -119,7 +115,6 @@
             "test100": {
                 "asset_tag": "123456789",
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -171,7 +166,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -191,7 +185,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -211,7 +204,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -231,7 +223,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-legacy.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-legacy.json
index ae5166fb4..fed907d3a 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-legacy.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-legacy.json
@@ -3,7 +3,6 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
-                "cluster_device": "",
                 "custom_fields": {},
                 "device_roles": [
                     "core-switch"
@@ -38,7 +37,6 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
-                "cluster_device": "",
                 "custom_fields": {},
                 "device_roles": [
                     "core-switch"
@@ -100,7 +98,6 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
@@ -142,7 +139,6 @@
                 "tags": []
             },
             "TestDeviceR1": {
-                "cluster_device": "",
                 "custom_fields": {},
                 "device_roles": [
                     "core-switch"
@@ -183,7 +179,6 @@
             "test100": {
                 "asset_tag": "123456789",
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -312,7 +307,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -338,7 +332,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -364,7 +357,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -390,7 +382,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-noracks.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-noracks.json
index 941dd3794..0054b9570 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-noracks.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-noracks.json
@@ -3,7 +3,6 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
-                "cluster_device": "",
                 "config_context": [
                     {}
                 ],
@@ -37,7 +36,6 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
-                "cluster_device": "",
                 "config_context": [
                     {}
                 ],
@@ -317,7 +315,6 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
@@ -415,7 +412,6 @@
                 "tags": []
             },
             "TestDeviceR1": {
-                "cluster_device": "",
                 "config_context": [
                     {}
                 ],
@@ -453,7 +449,6 @@
             "test100": {
                 "asset_tag": "123456789",
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -937,7 +932,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1097,7 +1091,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1126,7 +1119,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1155,7 +1147,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-options-flatten.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-options-flatten.json
index a104862d4..d16ef269d 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-options-flatten.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-options-flatten.json
@@ -28,7 +28,6 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
-                "cluster_device": "",
                 "device_type": "cisco-test",
                 "interfaces": [],
                 "is_virtual": false,
@@ -50,7 +49,6 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
-                "cluster_device": "",
                 "device_type": "nexus-parent",
                 "dns_name": "nexus.example.com",
                 "interfaces": [
@@ -319,7 +317,6 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [
                     {
@@ -411,7 +408,6 @@
                 "tags": []
             },
             "TestDeviceR1": {
-                "cluster_device": "",
                 "device_type": "cisco-test",
                 "interfaces": [],
                 "is_virtual": false,
@@ -439,7 +435,6 @@
             "test100": {
                 "asset_tag": "123456789",
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "device_type": "cisco-test",
@@ -899,7 +894,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [
@@ -1051,7 +1045,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
@@ -1072,7 +1065,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
@@ -1093,7 +1085,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-options.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-options.json
index c7e1cc200..a0bfd8b5e 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-options.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-options.json
@@ -28,7 +28,6 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
-                "cluster_device": "",
                 "custom_fields": {},
                 "device_type": "cisco-test",
                 "is_virtual": false,
@@ -50,7 +49,6 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
@@ -64,7 +62,6 @@
                 "tags": []
             },
             "TestDeviceR1": {
-                "cluster_device": "",
                 "custom_fields": {},
                 "device_type": "cisco-test",
                 "is_virtual": false,
@@ -91,7 +88,6 @@
             },
             "VC1": {
                 "ansible_host": "nexus.example.com",
-                "cluster_device": "",
                 "custom_fields": {},
                 "device_type": "nexus-parent",
                 "dns_name": "nexus.example.com",
@@ -119,7 +115,6 @@
             "test100": {
                 "asset_tag": "123456789",
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -171,7 +166,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -191,7 +185,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -211,7 +204,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -231,7 +223,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals-flatten.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals-flatten.json
index 23d530990..6b587653f 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals-flatten.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals-flatten.json
@@ -28,7 +28,6 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
-                "cluster_device": "",
                 "device_roles": [
                     "core-switch"
                 ],
@@ -61,7 +60,6 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
-                "cluster_device": "",
                 "device_roles": [
                     "core-switch"
                 ],
@@ -97,7 +95,6 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
                 "local_context_data": [
@@ -113,7 +110,6 @@
                 "tags": []
             },
             "TestDeviceR1": {
-                "cluster_device": "",
                 "device_roles": [
                     "core-switch"
                 ],
@@ -152,7 +148,6 @@
             "test100": {
                 "asset_tag": "123456789",
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "device_roles": [
@@ -220,7 +215,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -244,7 +238,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -268,7 +261,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -292,7 +284,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
                 "local_context_data": [
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json
index 9c5d06d38..7246c683b 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-plurals.json
@@ -3,7 +3,6 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
-                "cluster_device": "",
                 "config_context": [
                     {}
                 ],
@@ -42,7 +41,6 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
-                "cluster_device": "",
                 "config_context": [
                     {}
                 ],
@@ -326,7 +324,6 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
@@ -425,7 +422,6 @@
                 "tags": []
             },
             "TestDeviceR1": {
-                "cluster_device": "",
                 "config_context": [
                     {}
                 ],
@@ -470,7 +466,6 @@
             "test100": {
                 "asset_tag": "123456789",
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -959,7 +954,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1120,7 +1114,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1150,7 +1143,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1180,7 +1172,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory.json b/tests/integration/targets/inventory-v3.5/files/test-inventory.json
index 768b7787c..d3c47a788 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory.json
@@ -3,7 +3,6 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
-                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "cisco-test",
@@ -27,7 +26,6 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
-                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "nexus-parent",
@@ -298,7 +296,6 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
@@ -392,7 +389,6 @@
                 "tags": []
             },
             "TestDeviceR1": {
-                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "cisco-test",
@@ -422,7 +418,6 @@
             "test100": {
                 "asset_tag": "123456789",
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {
@@ -892,7 +887,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1046,7 +1040,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1069,7 +1062,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1092,7 +1084,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
@@ -1272,6 +1263,7 @@
             "location_parent_rack_group"
         ],
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json
index 64478c218..ad40632e8 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json
@@ -48,23 +48,23 @@
                             "id": 4,
                             "name": "Test Nexus One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -88,7 +88,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -134,17 +134,17 @@
                         "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -168,7 +168,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -417,6 +417,9 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "config_context": {
                     "ntp_servers": [
                         "pool.ntp.org"
@@ -884,7 +887,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1038,7 +1040,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1061,7 +1062,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1084,7 +1084,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
@@ -1130,6 +1129,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1144,6 +1144,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1153,6 +1154,7 @@
     "cluster_type_test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1261,6 +1263,7 @@
             "location_parent_rack_group"
         ],
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2-filter.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2-filter.json
index 44d4a173f..8a004b620 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2-filter.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2-filter.json
@@ -767,7 +767,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -921,7 +920,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -944,7 +942,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1099,6 +1096,7 @@
             "location_parent_rack_group"
         ],
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2.json
index 7322bc54b..0a347d7ee 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2.json
@@ -1,6 +1,7 @@
 {
     "Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -162,7 +163,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -182,7 +182,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -202,7 +201,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -222,7 +220,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-legacy.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-legacy.json
index 168c09f86..fed907d3a 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-legacy.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-legacy.json
@@ -178,6 +178,9 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "device_roles": [
                     "core-switch"
@@ -304,7 +307,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -330,7 +332,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -356,7 +357,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -382,7 +382,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-noracks.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-noracks.json
index 7a67324f5..0054b9570 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-noracks.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-noracks.json
@@ -61,27 +61,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -105,7 +105,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -141,27 +141,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -185,7 +185,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -448,6 +448,9 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "config_context": [
                     {
                         "ntp_servers": [
@@ -929,7 +932,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1089,7 +1091,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1118,7 +1119,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1147,7 +1147,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
@@ -1191,6 +1190,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1205,6 +1205,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1214,6 +1215,7 @@
     "cluster_type_test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-options-flatten.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-options-flatten.json
index 9bf028960..72d3127f3 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-options-flatten.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-options-flatten.json
@@ -1,6 +1,7 @@
 {
     "Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -64,27 +65,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -108,7 +109,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -144,27 +145,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -188,7 +189,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -890,7 +891,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [
@@ -1042,7 +1042,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
@@ -1063,7 +1062,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
@@ -1084,7 +1082,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
                 "is_virtual": true,
@@ -1192,6 +1189,7 @@
     },
     "test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1201,6 +1199,7 @@
     "test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-options.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-options.json
index 7322bc54b..a0bfd8b5e 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-options.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-options.json
@@ -1,6 +1,7 @@
 {
     "Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -113,6 +114,9 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "device_type": "cisco-test",
                 "is_virtual": false,
@@ -162,7 +166,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -182,7 +185,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -202,7 +204,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -222,7 +223,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
@@ -336,6 +336,7 @@
     },
     "test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -345,6 +346,7 @@
     "test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals-flatten.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals-flatten.json
index e8fa4cbe1..93acd4348 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals-flatten.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals-flatten.json
@@ -1,6 +1,7 @@
 {
     "Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -211,7 +212,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -235,7 +235,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -259,7 +258,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -283,7 +281,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
                 "local_context_data": [
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals.json
index 7e414dce5..7246c683b 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-plurals.json
@@ -66,27 +66,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -110,7 +110,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -146,27 +146,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -190,7 +190,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -465,6 +465,9 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "config_context": [
                     {
                         "ntp_servers": [
@@ -951,7 +954,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1112,7 +1114,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1142,7 +1143,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1172,7 +1172,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
@@ -1220,6 +1219,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1234,6 +1234,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1243,6 +1244,7 @@
     "cluster_type_test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory.json b/tests/integration/targets/inventory-v3.6/files/test-inventory.json
index 64478c218..d387fff46 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory.json
@@ -48,23 +48,23 @@
                             "id": 4,
                             "name": "Test Nexus One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -88,7 +88,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -124,27 +124,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -168,7 +168,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -417,6 +417,9 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "config_context": {
                     "ntp_servers": [
                         "pool.ntp.org"
@@ -884,7 +887,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1038,7 +1040,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1061,7 +1062,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1084,7 +1084,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
@@ -1130,6 +1129,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1144,6 +1144,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1153,6 +1154,7 @@
     "cluster_type_test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1261,6 +1263,7 @@
             "location_parent_rack_group"
         ],
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/reference.json b/tests/integration/targets/inventory-v3.7/files/reference.json
similarity index 99%
rename from tests/integration/targets/inventory-v3.5/files/reference.json
rename to tests/integration/targets/inventory-v3.7/files/reference.json
index e5a18b2a8..5f8e21266 100644
--- a/tests/integration/targets/inventory-v3.5/files/reference.json
+++ b/tests/integration/targets/inventory-v3.7/files/reference.json
@@ -3,7 +3,6 @@
         "hostvars": {
             "R1-Device": {
                 "asset_tag": "345678901",
-                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "cisco-test",
@@ -27,7 +26,6 @@
             },
             "Test Nexus One": {
                 "ansible_host": "172.16.180.12",
-                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "nexus-parent",
@@ -320,7 +318,6 @@
             },
             "Test VM With Spaces": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
@@ -426,7 +423,6 @@
                 "tags": []
             },
             "TestDeviceR1": {
-                "cluster_device": "",
                 "config_context": {},
                 "custom_fields": {},
                 "device_type": "cisco-test",
@@ -456,7 +452,6 @@
             "test100": {
                 "asset_tag": "123456789",
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {
@@ -974,7 +969,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1148,7 +1142,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1171,7 +1164,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1194,7 +1186,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json
index 64478c218..ff1790bd5 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json
@@ -48,23 +48,23 @@
                             "id": 4,
                             "name": "Test Nexus One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -88,7 +88,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -124,27 +124,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -168,7 +168,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -884,7 +884,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1038,7 +1037,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1061,7 +1059,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1084,7 +1081,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
@@ -1130,6 +1126,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1144,6 +1141,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1153,6 +1151,7 @@
     "cluster_type_test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1261,6 +1260,7 @@
             "location_parent_rack_group"
         ],
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json
index 44d4a173f..8a004b620 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json
@@ -767,7 +767,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -921,7 +920,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -944,7 +942,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1099,6 +1096,7 @@
             "location_parent_rack_group"
         ],
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.json
index 7322bc54b..0a347d7ee 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.json
@@ -1,6 +1,7 @@
 {
     "Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -162,7 +163,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -182,7 +182,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -202,7 +201,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -222,7 +220,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.json
index 168c09f86..fed907d3a 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.json
@@ -178,6 +178,9 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "device_roles": [
                     "core-switch"
@@ -304,7 +307,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -330,7 +332,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -356,7 +357,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -382,7 +382,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.json
index 7a67324f5..0054b9570 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.json
@@ -61,27 +61,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -105,7 +105,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -141,27 +141,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -185,7 +185,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -448,6 +448,9 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "config_context": [
                     {
                         "ntp_servers": [
@@ -929,7 +932,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1089,7 +1091,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1118,7 +1119,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1147,7 +1147,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
@@ -1191,6 +1190,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1205,6 +1205,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1214,6 +1215,7 @@
     "cluster_type_test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.json
index 9bf028960..d0474539b 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.json
@@ -1,6 +1,7 @@
 {
     "Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -64,27 +65,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -108,7 +109,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -144,27 +145,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -188,7 +189,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -890,7 +891,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [
@@ -1042,7 +1042,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
@@ -1063,7 +1062,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
@@ -1084,7 +1082,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "interfaces": [],
                 "is_virtual": true,
@@ -1201,6 +1198,7 @@
     "test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-options.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-options.json
index 7322bc54b..a0bfd8b5e 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-options.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-options.json
@@ -1,6 +1,7 @@
 {
     "Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -113,6 +114,9 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "device_type": "cisco-test",
                 "is_virtual": false,
@@ -162,7 +166,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -182,7 +185,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -202,7 +204,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
@@ -222,7 +223,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "custom_fields": {},
                 "is_virtual": true,
@@ -336,6 +336,7 @@
     },
     "test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -345,6 +346,7 @@
     "test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.json
index e8fa4cbe1..6b587653f 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.json
@@ -1,6 +1,7 @@
 {
     "Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -146,6 +147,9 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "device_roles": [
                     "core-switch"
                 ],
@@ -211,7 +215,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -235,7 +238,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -259,7 +261,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
@@ -283,7 +284,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "is_virtual": true,
                 "local_context_data": [
@@ -392,6 +392,7 @@
     },
     "test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -401,6 +402,7 @@
     "test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json
index 7e414dce5..74f43d76a 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json
@@ -66,27 +66,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -110,7 +110,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -146,27 +146,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
                         "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -190,7 +190,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -465,6 +465,9 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "config_context": [
                     {
                         "ntp_servers": [
@@ -951,7 +954,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1112,7 +1114,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1142,7 +1143,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
@@ -1172,7 +1172,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": [
                     {}
@@ -1220,6 +1219,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1234,6 +1234,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1243,6 +1244,7 @@
     "cluster_type_test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory.json b/tests/integration/targets/inventory-v3.7/files/test-inventory.json
index 64478c218..d3c47a788 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory.json
@@ -44,27 +44,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
-                        "display": "Ethernet1/1",
+                        "display": "Ethernet2/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 1,
+                        "id": 2,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.11/24",
+                                "address": "172.16.180.12/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
+                                "display": "172.16.180.12/24",
+                                "dns_name": "nexus.example.com",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 3,
+                                "id": 4,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -88,7 +88,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet1/1",
+                        "name": "Ethernet2/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -124,27 +124,27 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
-                                "address": "172.16.180.12/24",
+                                "address": "172.16.180.11/24",
                                 "comments": "",
                                 "custom_fields": {},
                                 "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
+                                "display": "172.16.180.11/24",
+                                "dns_name": "",
                                 "family": {
                                     "label": "IPv4",
                                     "value": 4
                                 },
-                                "id": 4,
+                                "id": 3,
                                 "nat_inside": null,
                                 "nat_outside": [],
                                 "role": null,
@@ -168,7 +168,7 @@
                         "mode": null,
                         "module": null,
                         "mtu": null,
-                        "name": "Ethernet2/1",
+                        "name": "Ethernet1/1",
                         "parent": null,
                         "poe_mode": null,
                         "poe_type": null,
@@ -417,6 +417,9 @@
             },
             "test100": {
                 "asset_tag": "123456789",
+                "cluster": "Test Cluster",
+                "cluster_group": "test-cluster-group",
+                "cluster_type": "test-cluster-type",
                 "config_context": {
                     "ntp_servers": [
                         "pool.ntp.org"
@@ -884,7 +887,6 @@
             },
             "test101-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1038,7 +1040,6 @@
             },
             "test102-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1061,7 +1062,6 @@
             },
             "test103-vm": {
                 "cluster": "Test Cluster",
-                "cluster_device": "",
                 "cluster_group": "test-cluster-group",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
@@ -1084,7 +1084,6 @@
             },
             "test104-vm": {
                 "cluster": "Test Cluster 2",
-                "cluster_device": "",
                 "cluster_type": "test-cluster-type",
                 "config_context": {},
                 "custom_fields": {},
@@ -1130,6 +1129,7 @@
     },
     "cluster_Test_Cluster": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1144,6 +1144,7 @@
     },
     "cluster_group_test_cluster_group": {
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1153,6 +1154,7 @@
     "cluster_type_test_cluster_type": {
         "hosts": [
             "Test VM With Spaces",
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
@@ -1261,6 +1263,7 @@
             "location_parent_rack_group"
         ],
         "hosts": [
+            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",

From 360d38c3cb1cb0ce0346b8c5e4983899ed4c7fa9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Mon, 19 Feb 2024 10:46:44 +0100
Subject: [PATCH 13/15] align the integration tests to new implementation and
 featureset - debug

---
 .../inventory-v3.5/files/test-inventory-bearer-token.json        | 1 -
 .../inventory-v3.5/files/test-inventory-jinja2-filter.json       | 1 -
 .../integration/targets/inventory-v3.5/files/test-inventory.json | 1 -
 .../inventory-v3.6/files/test-inventory-bearer-token.json        | 1 -
 .../inventory-v3.6/files/test-inventory-jinja2-filter.json       | 1 -
 .../integration/targets/inventory-v3.6/files/test-inventory.json | 1 -
 .../inventory-v3.7/files/test-inventory-bearer-token.json        | 1 -
 .../inventory-v3.7/files/test-inventory-jinja2-filter.json       | 1 -
 .../integration/targets/inventory-v3.7/files/test-inventory.json | 1 -
 9 files changed, 9 deletions(-)

diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json
index d3c47a788..2b0dde241 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-bearer-token.json
@@ -1263,7 +1263,6 @@
             "location_parent_rack_group"
         ],
         "hosts": [
-            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json
index e16ac23d8..f0693bd1c 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory-jinja2-filter.json
@@ -1102,7 +1102,6 @@
             "location_parent_rack_group"
         ],
         "hosts": [
-            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.5/files/test-inventory.json b/tests/integration/targets/inventory-v3.5/files/test-inventory.json
index d3c47a788..2b0dde241 100644
--- a/tests/integration/targets/inventory-v3.5/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.5/files/test-inventory.json
@@ -1263,7 +1263,6 @@
             "location_parent_rack_group"
         ],
         "hosts": [
-            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json
index ad40632e8..da011e362 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json
@@ -1263,7 +1263,6 @@
             "location_parent_rack_group"
         ],
         "hosts": [
-            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2-filter.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2-filter.json
index 8a004b620..9f959ebd9 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2-filter.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-jinja2-filter.json
@@ -1096,7 +1096,6 @@
             "location_parent_rack_group"
         ],
         "hosts": [
-            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory.json b/tests/integration/targets/inventory-v3.6/files/test-inventory.json
index d387fff46..27206e8f6 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory.json
@@ -1263,7 +1263,6 @@
             "location_parent_rack_group"
         ],
         "hosts": [
-            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json
index ff1790bd5..53c512bc9 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json
@@ -1260,7 +1260,6 @@
             "location_parent_rack_group"
         ],
         "hosts": [
-            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json
index 8a004b620..9f959ebd9 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json
@@ -1096,7 +1096,6 @@
             "location_parent_rack_group"
         ],
         "hosts": [
-            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory.json b/tests/integration/targets/inventory-v3.7/files/test-inventory.json
index d3c47a788..2b0dde241 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory.json
@@ -1263,7 +1263,6 @@
             "location_parent_rack_group"
         ],
         "hosts": [
-            "test100",
             "test100-vm",
             "test101-vm",
             "test102-vm",

From cdec142113b3bb211b03f506302f4503732b235f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Mon, 19 Feb 2024 12:07:44 +0100
Subject: [PATCH 14/15] align the integration tests to new implementation and
 featureset - debug

---
 .../files/test-inventory-bearer-token.json    |   16 +-
 .../inventory-v3.6/files/test-inventory.json  |    6 +-
 .../inventory-v3.7/files/reference.json       | 1393 -----------------
 .../files/test-inventory-plurals.json         |    2 +-
 4 files changed, 12 insertions(+), 1405 deletions(-)
 delete mode 100644 tests/integration/targets/inventory-v3.7/files/reference.json

diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json b/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json
index da011e362..2b0dde241 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory-bearer-token.json
@@ -44,9 +44,9 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
                         "display": "Ethernet2/1",
                         "duplex": null,
@@ -124,14 +124,14 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One"
+                            "display": "Test Nexus One",
+                            "id": 4,
+                            "name": "Test Nexus One"
                         },
-                        "display": "Ethernet2/1",
+                        "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
                                 "address": "172.16.180.11/24",
diff --git a/tests/integration/targets/inventory-v3.6/files/test-inventory.json b/tests/integration/targets/inventory-v3.6/files/test-inventory.json
index 27206e8f6..2b0dde241 100644
--- a/tests/integration/targets/inventory-v3.6/files/test-inventory.json
+++ b/tests/integration/targets/inventory-v3.6/files/test-inventory.json
@@ -44,9 +44,9 @@
                         "custom_fields": {},
                         "description": "",
                         "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One"
+                            "display": "Test Nexus Child One",
+                            "id": 5,
+                            "name": "Test Nexus Child One"
                         },
                         "display": "Ethernet2/1",
                         "duplex": null,
diff --git a/tests/integration/targets/inventory-v3.7/files/reference.json b/tests/integration/targets/inventory-v3.7/files/reference.json
deleted file mode 100644
index 5f8e21266..000000000
--- a/tests/integration/targets/inventory-v3.7/files/reference.json
+++ /dev/null
@@ -1,1393 +0,0 @@
-{
-    "_meta": {
-        "hostvars": {
-            "R1-Device": {
-                "asset_tag": "345678901",
-                "config_context": {},
-                "custom_fields": {},
-                "device_type": "cisco-test",
-                "interfaces": [],
-                "is_virtual": false,
-                "locations": [],
-                "manufacturer": "cisco",
-                "rack": "Test Rack Site 2",
-                "rack_role": "test-rack-role",
-                "regions": [],
-                "role": "core-switch",
-                "serial": "",
-                "services": [],
-                "site": "test-site2",
-                "site_groups": [],
-                "status": {
-                    "label": "Active",
-                    "value": "active"
-                },
-                "tags": []
-            },
-            "Test Nexus One": {
-                "ansible_host": "172.16.180.12",
-                "config_context": {},
-                "custom_fields": {},
-                "device_type": "nexus-parent",
-                "dns_name": "nexus.example.com",
-                "interfaces": [
-                    {
-                        "_occupied": false,
-                        "bridge": null,
-                        "cable": null,
-                        "cable_end": "",
-                        "connected_endpoints": null,
-                        "connected_endpoints_reachable": null,
-                        "connected_endpoints_type": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 1,
-                        "created": "2024-02-14T11:44:32.091746Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "device": {
-                            "display": "Test Nexus Child One",
-                            "id": 5,
-                            "name": "Test Nexus Child One",
-                            "url": "http://localhost:32768/api/dcim/devices/5/"
-                        },
-                        "display": "Ethernet2/1",
-                        "duplex": null,
-                        "enabled": true,
-                        "id": 2,
-                        "ip_addresses": [
-                            {
-                                "address": "172.16.180.12/24",
-                                "comments": "",
-                                "created": "2024-02-14T11:44:32.515127Z",
-                                "custom_fields": {},
-                                "description": "",
-                                "display": "172.16.180.12/24",
-                                "dns_name": "nexus.example.com",
-                                "family": {
-                                    "label": "IPv4",
-                                    "value": 4
-                                },
-                                "id": 4,
-                                "last_updated": "2024-02-14T11:44:32.515133Z",
-                                "nat_inside": null,
-                                "nat_outside": [],
-                                "role": null,
-                                "status": {
-                                    "label": "Active",
-                                    "value": "active"
-                                },
-                                "tags": [],
-                                "tenant": null,
-                                "url": "http://localhost:32768/api/ipam/ip-addresses/4/",
-                                "vrf": null
-                            }
-                        ],
-                        "l2vpn_termination": null,
-                        "label": "",
-                        "lag": null,
-                        "last_updated": "2024-02-14T11:44:32.091756Z",
-                        "link_peers": [],
-                        "link_peers_type": null,
-                        "mac_address": null,
-                        "mark_connected": false,
-                        "mgmt_only": false,
-                        "mode": null,
-                        "module": null,
-                        "mtu": null,
-                        "name": "Ethernet2/1",
-                        "parent": null,
-                        "poe_mode": null,
-                        "poe_type": null,
-                        "rf_channel": null,
-                        "rf_channel_frequency": null,
-                        "rf_channel_width": null,
-                        "rf_role": null,
-                        "speed": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "tx_power": null,
-                        "type": {
-                            "label": "1000BASE-T (1GE)",
-                            "value": "1000base-t"
-                        },
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/dcim/interfaces/2/",
-                        "vdcs": [],
-                        "vrf": null,
-                        "wireless_lans": [],
-                        "wireless_link": null,
-                        "wwn": null
-                    },
-                    {
-                        "_occupied": false,
-                        "bridge": null,
-                        "cable": null,
-                        "cable_end": "",
-                        "connected_endpoints": null,
-                        "connected_endpoints_reachable": null,
-                        "connected_endpoints_type": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 1,
-                        "created": "2024-02-14T11:44:32.060428Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One",
-                            "url": "http://localhost:32768/api/dcim/devices/4/"
-                        },
-                        "display": "Ethernet1/1",
-                        "duplex": null,
-                        "enabled": true,
-                        "id": 1,
-                        "ip_addresses": [
-                            {
-                                "address": "172.16.180.11/24",
-                                "comments": "",
-                                "created": "2024-02-14T11:44:32.505456Z",
-                                "custom_fields": {},
-                                "description": "",
-                                "display": "172.16.180.11/24",
-                                "dns_name": "",
-                                "family": {
-                                    "label": "IPv4",
-                                    "value": 4
-                                },
-                                "id": 3,
-                                "last_updated": "2024-02-14T11:44:32.505462Z",
-                                "nat_inside": null,
-                                "nat_outside": [],
-                                "role": null,
-                                "status": {
-                                    "label": "Active",
-                                    "value": "active"
-                                },
-                                "tags": [],
-                                "tenant": null,
-                                "url": "http://localhost:32768/api/ipam/ip-addresses/3/",
-                                "vrf": null
-                            }
-                        ],
-                        "l2vpn_termination": null,
-                        "label": "",
-                        "lag": null,
-                        "last_updated": "2024-02-14T11:44:32.060441Z",
-                        "link_peers": [],
-                        "link_peers_type": null,
-                        "mac_address": null,
-                        "mark_connected": false,
-                        "mgmt_only": false,
-                        "mode": null,
-                        "module": null,
-                        "mtu": null,
-                        "name": "Ethernet1/1",
-                        "parent": null,
-                        "poe_mode": null,
-                        "poe_type": null,
-                        "rf_channel": null,
-                        "rf_channel_frequency": null,
-                        "rf_channel_width": null,
-                        "rf_role": null,
-                        "speed": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "tx_power": null,
-                        "type": {
-                            "label": "1000BASE-T (1GE)",
-                            "value": "1000base-t"
-                        },
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/dcim/interfaces/1/",
-                        "vdcs": [],
-                        "vrf": null,
-                        "wireless_lans": [],
-                        "wireless_link": null,
-                        "wwn": null
-                    },
-                    {
-                        "_occupied": false,
-                        "bridge": null,
-                        "cable": null,
-                        "cable_end": "",
-                        "connected_endpoints": null,
-                        "connected_endpoints_reachable": null,
-                        "connected_endpoints_type": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:32.232803Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One",
-                            "url": "http://localhost:32768/api/dcim/devices/4/"
-                        },
-                        "display": "wlink1",
-                        "duplex": null,
-                        "enabled": true,
-                        "id": 6,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "label": "",
-                        "lag": null,
-                        "last_updated": "2024-02-14T11:44:32.232813Z",
-                        "link_peers": [],
-                        "link_peers_type": null,
-                        "mac_address": null,
-                        "mark_connected": false,
-                        "mgmt_only": false,
-                        "mode": null,
-                        "module": null,
-                        "mtu": null,
-                        "name": "wlink1",
-                        "parent": null,
-                        "poe_mode": null,
-                        "poe_type": null,
-                        "rf_channel": null,
-                        "rf_channel_frequency": null,
-                        "rf_channel_width": null,
-                        "rf_role": null,
-                        "speed": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "tx_power": null,
-                        "type": {
-                            "label": "IEEE 802.11a",
-                            "value": "ieee802.11a"
-                        },
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/dcim/interfaces/6/",
-                        "vdcs": [],
-                        "vrf": null,
-                        "wireless_lans": [],
-                        "wireless_link": null,
-                        "wwn": null
-                    }
-                ],
-                "is_virtual": false,
-                "locations": [
-                    "test-rack-group",
-                    "parent-rack-group"
-                ],
-                "manufacturer": "cisco",
-                "primary_ip4": "172.16.180.12",
-                "regions": [
-                    "test-region",
-                    "parent-region"
-                ],
-                "role": "core-switch",
-                "serial": "",
-                "services": [
-                    {
-                        "comments": "",
-                        "created": "2024-02-14T11:44:33.208305Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "device": {
-                            "display": "Test Nexus One",
-                            "id": 4,
-                            "name": "Test Nexus One",
-                            "url": "http://localhost:32768/api/dcim/devices/4/"
-                        },
-                        "display": "telnet (TCP/23)",
-                        "id": 3,
-                        "ipaddresses": [],
-                        "last_updated": "2024-02-14T11:44:33.208311Z",
-                        "name": "telnet",
-                        "ports": [
-                            23
-                        ],
-                        "protocol": {
-                            "label": "TCP",
-                            "value": "tcp"
-                        },
-                        "tags": [],
-                        "url": "http://localhost:32768/api/ipam/services/3/",
-                        "virtual_machine": null
-                    }
-                ],
-                "site": "test-site",
-                "site_groups": [],
-                "status": {
-                    "label": "Active",
-                    "value": "active"
-                },
-                "tags": []
-            },
-            "Test VM With Spaces": {
-                "cluster": "Test Cluster 2",
-                "cluster_type": "test-cluster-type",
-                "config_context": {},
-                "custom_fields": {},
-                "interfaces": [
-                    {
-                        "bridge": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:33.086508Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "display": "Eth0",
-                        "enabled": true,
-                        "id": 11,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "last_updated": "2024-02-14T11:44:33.086515Z",
-                        "mac_address": null,
-                        "mode": null,
-                        "mtu": null,
-                        "name": "Eth0",
-                        "parent": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/virtualization/interfaces/11/",
-                        "virtual_machine": {
-                            "display": "Test VM With Spaces",
-                            "id": 6,
-                            "name": "Test VM With Spaces",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/6/"
-                        },
-                        "vrf": null
-                    },
-                    {
-                        "bridge": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:33.096917Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "display": "Eth1",
-                        "enabled": true,
-                        "id": 12,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "last_updated": "2024-02-14T11:44:33.096924Z",
-                        "mac_address": null,
-                        "mode": null,
-                        "mtu": null,
-                        "name": "Eth1",
-                        "parent": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/virtualization/interfaces/12/",
-                        "virtual_machine": {
-                            "display": "Test VM With Spaces",
-                            "id": 6,
-                            "name": "Test VM With Spaces",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/6/"
-                        },
-                        "vrf": null
-                    }
-                ],
-                "is_virtual": true,
-                "locations": [],
-                "regions": [],
-                "services": [
-                    {
-                        "comments": "",
-                        "created": "2024-02-14T11:44:33.215473Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "device": null,
-                        "display": "ssh (TCP/22)",
-                        "id": 4,
-                        "ipaddresses": [],
-                        "last_updated": "2024-02-14T11:44:33.215478Z",
-                        "name": "ssh",
-                        "ports": [
-                            22
-                        ],
-                        "protocol": {
-                            "label": "TCP",
-                            "value": "tcp"
-                        },
-                        "tags": [],
-                        "url": "http://localhost:32768/api/ipam/services/4/",
-                        "virtual_machine": {
-                            "display": "Test VM With Spaces",
-                            "id": 6,
-                            "name": "Test VM With Spaces",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/6/"
-                        }
-                    }
-                ],
-                "site_groups": [],
-                "status": {
-                    "label": "Active",
-                    "value": "active"
-                },
-                "tags": []
-            },
-            "TestDeviceR1": {
-                "config_context": {},
-                "custom_fields": {},
-                "device_type": "cisco-test",
-                "interfaces": [],
-                "is_virtual": false,
-                "locations": [
-                    "test-rack-group",
-                    "parent-rack-group"
-                ],
-                "manufacturer": "cisco",
-                "rack": "Test Rack",
-                "regions": [
-                    "test-region",
-                    "parent-region"
-                ],
-                "role": "core-switch",
-                "serial": "FAB12345678",
-                "services": [],
-                "site": "test-site",
-                "site_groups": [],
-                "status": {
-                    "label": "Active",
-                    "value": "active"
-                },
-                "tags": []
-            },
-            "test100": {
-                "asset_tag": "123456789",
-                "cluster": "Test Cluster",
-                "cluster_group": "test-cluster-group",
-                "cluster_type": "test-cluster-type",
-                "config_context": {
-                    "ntp_servers": [
-                        "pool.ntp.org"
-                    ]
-                },
-                "custom_fields": {},
-                "device_type": "cisco-test",
-                "interfaces": [
-                    {
-                        "_occupied": false,
-                        "bridge": null,
-                        "cable": null,
-                        "cable_end": "",
-                        "connected_endpoints": null,
-                        "connected_endpoints_reachable": null,
-                        "connected_endpoints_type": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 1,
-                        "created": "2024-02-14T11:44:32.149514Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "device": {
-                            "display": "test100 (123456789)",
-                            "id": 1,
-                            "name": "test100",
-                            "url": "http://localhost:32768/api/dcim/devices/1/"
-                        },
-                        "display": "GigabitEthernet1",
-                        "duplex": null,
-                        "enabled": true,
-                        "id": 3,
-                        "ip_addresses": [
-                            {
-                                "address": "172.16.180.1/24",
-                                "comments": "",
-                                "created": "2024-02-14T11:44:32.484105Z",
-                                "custom_fields": {},
-                                "description": "",
-                                "display": "172.16.180.1/24",
-                                "dns_name": "",
-                                "family": {
-                                    "label": "IPv4",
-                                    "value": 4
-                                },
-                                "id": 1,
-                                "last_updated": "2024-02-14T11:44:32.484118Z",
-                                "nat_inside": null,
-                                "nat_outside": [],
-                                "role": null,
-                                "status": {
-                                    "label": "Active",
-                                    "value": "active"
-                                },
-                                "tags": [],
-                                "tenant": null,
-                                "url": "http://localhost:32768/api/ipam/ip-addresses/1/",
-                                "vrf": null
-                            }
-                        ],
-                        "l2vpn_termination": null,
-                        "label": "",
-                        "lag": null,
-                        "last_updated": "2024-02-14T11:44:32.149526Z",
-                        "link_peers": [],
-                        "link_peers_type": null,
-                        "mac_address": null,
-                        "mark_connected": false,
-                        "mgmt_only": false,
-                        "mode": null,
-                        "module": null,
-                        "mtu": null,
-                        "name": "GigabitEthernet1",
-                        "parent": null,
-                        "poe_mode": null,
-                        "poe_type": null,
-                        "rf_channel": null,
-                        "rf_channel_frequency": null,
-                        "rf_channel_width": null,
-                        "rf_role": null,
-                        "speed": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "tx_power": null,
-                        "type": {
-                            "label": "1000BASE-T (1GE)",
-                            "value": "1000base-t"
-                        },
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/dcim/interfaces/3/",
-                        "vdcs": [],
-                        "vrf": null,
-                        "wireless_lans": [],
-                        "wireless_link": null,
-                        "wwn": null
-                    },
-                    {
-                        "_occupied": false,
-                        "bridge": null,
-                        "cable": null,
-                        "cable_end": "",
-                        "connected_endpoints": null,
-                        "connected_endpoints_reachable": null,
-                        "connected_endpoints_type": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 1,
-                        "created": "2024-02-14T11:44:32.168795Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "device": {
-                            "display": "test100 (123456789)",
-                            "id": 1,
-                            "name": "test100",
-                            "url": "http://localhost:32768/api/dcim/devices/1/"
-                        },
-                        "display": "GigabitEthernet2",
-                        "duplex": null,
-                        "enabled": true,
-                        "id": 4,
-                        "ip_addresses": [
-                            {
-                                "address": "2001::1:1/64",
-                                "comments": "",
-                                "created": "2024-02-14T11:44:32.494861Z",
-                                "custom_fields": {},
-                                "description": "",
-                                "display": "2001::1:1/64",
-                                "dns_name": "",
-                                "family": {
-                                    "label": "IPv6",
-                                    "value": 6
-                                },
-                                "id": 2,
-                                "last_updated": "2024-02-14T11:44:32.494868Z",
-                                "nat_inside": null,
-                                "nat_outside": [],
-                                "role": null,
-                                "status": {
-                                    "label": "Active",
-                                    "value": "active"
-                                },
-                                "tags": [],
-                                "tenant": null,
-                                "url": "http://localhost:32768/api/ipam/ip-addresses/2/",
-                                "vrf": null
-                            }
-                        ],
-                        "l2vpn_termination": null,
-                        "label": "",
-                        "lag": null,
-                        "last_updated": "2024-02-14T11:44:32.168802Z",
-                        "link_peers": [],
-                        "link_peers_type": null,
-                        "mac_address": null,
-                        "mark_connected": false,
-                        "mgmt_only": false,
-                        "mode": null,
-                        "module": null,
-                        "mtu": null,
-                        "name": "GigabitEthernet2",
-                        "parent": null,
-                        "poe_mode": null,
-                        "poe_type": null,
-                        "rf_channel": null,
-                        "rf_channel_frequency": null,
-                        "rf_channel_width": null,
-                        "rf_role": null,
-                        "speed": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "tx_power": null,
-                        "type": {
-                            "label": "1000BASE-T (1GE)",
-                            "value": "1000base-t"
-                        },
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/dcim/interfaces/4/",
-                        "vdcs": [],
-                        "vrf": null,
-                        "wireless_lans": [],
-                        "wireless_link": null,
-                        "wwn": null
-                    },
-                    {
-                        "_occupied": false,
-                        "bridge": null,
-                        "cable": null,
-                        "cable_end": "",
-                        "connected_endpoints": null,
-                        "connected_endpoints_reachable": null,
-                        "connected_endpoints_type": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:32.211879Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "device": {
-                            "display": "test100 (123456789)",
-                            "id": 1,
-                            "name": "test100",
-                            "url": "http://localhost:32768/api/dcim/devices/1/"
-                        },
-                        "display": "wlink1",
-                        "duplex": null,
-                        "enabled": true,
-                        "id": 5,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "label": "",
-                        "lag": null,
-                        "last_updated": "2024-02-14T11:44:32.211888Z",
-                        "link_peers": [],
-                        "link_peers_type": null,
-                        "mac_address": null,
-                        "mark_connected": false,
-                        "mgmt_only": false,
-                        "mode": null,
-                        "module": null,
-                        "mtu": null,
-                        "name": "wlink1",
-                        "parent": null,
-                        "poe_mode": null,
-                        "poe_type": null,
-                        "rf_channel": null,
-                        "rf_channel_frequency": null,
-                        "rf_channel_width": null,
-                        "rf_role": null,
-                        "speed": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "tx_power": null,
-                        "type": {
-                            "label": "IEEE 802.11a",
-                            "value": "ieee802.11a"
-                        },
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/dcim/interfaces/5/",
-                        "vdcs": [],
-                        "vrf": null,
-                        "wireless_lans": [],
-                        "wireless_link": null,
-                        "wwn": null
-                    }
-                ],
-                "is_virtual": false,
-                "local_context_data": {
-                    "ntp_servers": [
-                        "pool.ntp.org"
-                    ]
-                },
-                "locations": [
-                    "test-rack-group",
-                    "parent-rack-group"
-                ],
-                "manufacturer": "cisco",
-                "regions": [
-                    "test-region",
-                    "parent-region"
-                ],
-                "role": "core-switch",
-                "serial": "FAB01234567",
-                "services": [
-                    {
-                        "comments": "",
-                        "created": "2024-02-14T11:44:33.180356Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "device": {
-                            "display": "test100 (123456789)",
-                            "id": 1,
-                            "name": "test100",
-                            "url": "http://localhost:32768/api/dcim/devices/1/"
-                        },
-                        "display": "ssh (TCP/22)",
-                        "id": 1,
-                        "ipaddresses": [],
-                        "last_updated": "2024-02-14T11:44:33.180363Z",
-                        "name": "ssh",
-                        "ports": [
-                            22
-                        ],
-                        "protocol": {
-                            "label": "TCP",
-                            "value": "tcp"
-                        },
-                        "tags": [],
-                        "url": "http://localhost:32768/api/ipam/services/1/",
-                        "virtual_machine": null
-                    },
-                    {
-                        "comments": "",
-                        "created": "2024-02-14T11:44:33.189722Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "device": {
-                            "display": "test100 (123456789)",
-                            "id": 1,
-                            "name": "test100",
-                            "url": "http://localhost:32768/api/dcim/devices/1/"
-                        },
-                        "display": "http (TCP/80)",
-                        "id": 2,
-                        "ipaddresses": [
-                            {
-                                "address": "172.16.180.1/24",
-                                "display": "172.16.180.1/24",
-                                "family": 4,
-                                "id": 1,
-                                "url": "http://localhost:32768/api/ipam/ip-addresses/1/"
-                            },
-                            {
-                                "address": "2001::1:1/64",
-                                "display": "2001::1:1/64",
-                                "family": 6,
-                                "id": 2,
-                                "url": "http://localhost:32768/api/ipam/ip-addresses/2/"
-                            }
-                        ],
-                        "last_updated": "2024-02-14T11:44:33.189727Z",
-                        "name": "http",
-                        "ports": [
-                            80
-                        ],
-                        "protocol": {
-                            "label": "TCP",
-                            "value": "tcp"
-                        },
-                        "tags": [],
-                        "url": "http://localhost:32768/api/ipam/services/2/",
-                        "virtual_machine": null
-                    }
-                ],
-                "site": "test-site",
-                "site_groups": [],
-                "status": {
-                    "label": "Active",
-                    "value": "active"
-                },
-                "tags": []
-            },
-            "test100-vm": {
-                "cluster": "Test Cluster",
-                "cluster_device": "test100",
-                "cluster_group": "test-cluster-group",
-                "cluster_type": "test-cluster-type",
-                "config_context": {},
-                "custom_fields": {},
-                "interfaces": [
-                    {
-                        "bridge": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:32.977245Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "display": "Eth0",
-                        "enabled": true,
-                        "id": 1,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "last_updated": "2024-02-14T11:44:32.977256Z",
-                        "mac_address": null,
-                        "mode": null,
-                        "mtu": null,
-                        "name": "Eth0",
-                        "parent": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/virtualization/interfaces/1/",
-                        "virtual_machine": {
-                            "display": "test100-vm",
-                            "id": 1,
-                            "name": "test100-vm",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/1/"
-                        },
-                        "vrf": null
-                    },
-                    {
-                        "bridge": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:32.993554Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "display": "Eth1",
-                        "enabled": true,
-                        "id": 2,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "last_updated": "2024-02-14T11:44:32.993560Z",
-                        "mac_address": null,
-                        "mode": null,
-                        "mtu": null,
-                        "name": "Eth1",
-                        "parent": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/virtualization/interfaces/2/",
-                        "virtual_machine": {
-                            "display": "test100-vm",
-                            "id": 1,
-                            "name": "test100-vm",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/1/"
-                        },
-                        "vrf": null
-                    },
-                    {
-                        "bridge": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:33.003972Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "display": "Eth2",
-                        "enabled": true,
-                        "id": 3,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "last_updated": "2024-02-14T11:44:33.003978Z",
-                        "mac_address": null,
-                        "mode": null,
-                        "mtu": null,
-                        "name": "Eth2",
-                        "parent": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/virtualization/interfaces/3/",
-                        "virtual_machine": {
-                            "display": "test100-vm",
-                            "id": 1,
-                            "name": "test100-vm",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/1/"
-                        },
-                        "vrf": null
-                    },
-                    {
-                        "bridge": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:33.015262Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "display": "Eth3",
-                        "enabled": true,
-                        "id": 4,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "last_updated": "2024-02-14T11:44:33.015268Z",
-                        "mac_address": null,
-                        "mode": null,
-                        "mtu": null,
-                        "name": "Eth3",
-                        "parent": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/virtualization/interfaces/4/",
-                        "virtual_machine": {
-                            "display": "test100-vm",
-                            "id": 1,
-                            "name": "test100-vm",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/1/"
-                        },
-                        "vrf": null
-                    },
-                    {
-                        "bridge": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:33.025273Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "display": "Eth4",
-                        "enabled": true,
-                        "id": 5,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "last_updated": "2024-02-14T11:44:33.025279Z",
-                        "mac_address": null,
-                        "mode": null,
-                        "mtu": null,
-                        "name": "Eth4",
-                        "parent": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/virtualization/interfaces/5/",
-                        "virtual_machine": {
-                            "display": "test100-vm",
-                            "id": 1,
-                            "name": "test100-vm",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/1/"
-                        },
-                        "vrf": null
-                    }
-                ],
-                "is_virtual": true,
-                "locations": [],
-                "regions": [
-                    "test-region",
-                    "parent-region"
-                ],
-                "services": [],
-                "site": "test-site",
-                "site_groups": [],
-                "status": {
-                    "label": "Active",
-                    "value": "active"
-                },
-                "tags": []
-            },
-            "test101-vm": {
-                "cluster": "Test Cluster",
-                "cluster_group": "test-cluster-group",
-                "cluster_type": "test-cluster-type",
-                "config_context": {},
-                "custom_fields": {},
-                "interfaces": [
-                    {
-                        "bridge": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:33.035047Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "display": "Eth0",
-                        "enabled": true,
-                        "id": 6,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "last_updated": "2024-02-14T11:44:33.035053Z",
-                        "mac_address": null,
-                        "mode": null,
-                        "mtu": null,
-                        "name": "Eth0",
-                        "parent": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/virtualization/interfaces/6/",
-                        "virtual_machine": {
-                            "display": "test101-vm",
-                            "id": 2,
-                            "name": "test101-vm",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/2/"
-                        },
-                        "vrf": null
-                    },
-                    {
-                        "bridge": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:33.045622Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "display": "Eth1",
-                        "enabled": true,
-                        "id": 7,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "last_updated": "2024-02-14T11:44:33.045628Z",
-                        "mac_address": null,
-                        "mode": null,
-                        "mtu": null,
-                        "name": "Eth1",
-                        "parent": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/virtualization/interfaces/7/",
-                        "virtual_machine": {
-                            "display": "test101-vm",
-                            "id": 2,
-                            "name": "test101-vm",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/2/"
-                        },
-                        "vrf": null
-                    },
-                    {
-                        "bridge": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:33.056509Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "display": "Eth2",
-                        "enabled": true,
-                        "id": 8,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "last_updated": "2024-02-14T11:44:33.056515Z",
-                        "mac_address": null,
-                        "mode": null,
-                        "mtu": null,
-                        "name": "Eth2",
-                        "parent": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/virtualization/interfaces/8/",
-                        "virtual_machine": {
-                            "display": "test101-vm",
-                            "id": 2,
-                            "name": "test101-vm",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/2/"
-                        },
-                        "vrf": null
-                    },
-                    {
-                        "bridge": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:33.066290Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "display": "Eth3",
-                        "enabled": true,
-                        "id": 9,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "last_updated": "2024-02-14T11:44:33.066295Z",
-                        "mac_address": null,
-                        "mode": null,
-                        "mtu": null,
-                        "name": "Eth3",
-                        "parent": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/virtualization/interfaces/9/",
-                        "virtual_machine": {
-                            "display": "test101-vm",
-                            "id": 2,
-                            "name": "test101-vm",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/2/"
-                        },
-                        "vrf": null
-                    },
-                    {
-                        "bridge": null,
-                        "count_fhrp_groups": 0,
-                        "count_ipaddresses": 0,
-                        "created": "2024-02-14T11:44:33.076048Z",
-                        "custom_fields": {},
-                        "description": "",
-                        "display": "Eth4",
-                        "enabled": true,
-                        "id": 10,
-                        "ip_addresses": [],
-                        "l2vpn_termination": null,
-                        "last_updated": "2024-02-14T11:44:33.076054Z",
-                        "mac_address": null,
-                        "mode": null,
-                        "mtu": null,
-                        "name": "Eth4",
-                        "parent": null,
-                        "tagged_vlans": [],
-                        "tags": [],
-                        "untagged_vlan": null,
-                        "url": "http://localhost:32768/api/virtualization/interfaces/10/",
-                        "virtual_machine": {
-                            "display": "test101-vm",
-                            "id": 2,
-                            "name": "test101-vm",
-                            "url": "http://localhost:32768/api/virtualization/virtual-machines/2/"
-                        },
-                        "vrf": null
-                    }
-                ],
-                "is_virtual": true,
-                "locations": [],
-                "regions": [
-                    "test-region",
-                    "parent-region"
-                ],
-                "services": [],
-                "site": "test-site",
-                "site_groups": [],
-                "status": {
-                    "label": "Active",
-                    "value": "active"
-                },
-                "tags": []
-            },
-            "test102-vm": {
-                "cluster": "Test Cluster",
-                "cluster_group": "test-cluster-group",
-                "cluster_type": "test-cluster-type",
-                "config_context": {},
-                "custom_fields": {},
-                "interfaces": [],
-                "is_virtual": true,
-                "locations": [],
-                "regions": [
-                    "test-region",
-                    "parent-region"
-                ],
-                "services": [],
-                "site": "test-site",
-                "site_groups": [],
-                "status": {
-                    "label": "Active",
-                    "value": "active"
-                },
-                "tags": []
-            },
-            "test103-vm": {
-                "cluster": "Test Cluster",
-                "cluster_group": "test-cluster-group",
-                "cluster_type": "test-cluster-type",
-                "config_context": {},
-                "custom_fields": {},
-                "interfaces": [],
-                "is_virtual": true,
-                "locations": [],
-                "regions": [
-                    "test-region",
-                    "parent-region"
-                ],
-                "services": [],
-                "site": "test-site",
-                "site_groups": [],
-                "status": {
-                    "label": "Active",
-                    "value": "active"
-                },
-                "tags": []
-            },
-            "test104-vm": {
-                "cluster": "Test Cluster 2",
-                "cluster_type": "test-cluster-type",
-                "config_context": {},
-                "custom_fields": {},
-                "interfaces": [],
-                "is_virtual": true,
-                "locations": [],
-                "regions": [],
-                "services": [],
-                "site_groups": [],
-                "status": {
-                    "label": "Active",
-                    "value": "active"
-                },
-                "tags": []
-            }
-        }
-    },
-    "all": {
-        "children": [
-            "cluster_Test_Cluster",
-            "cluster_Test_Cluster_2",
-            "cluster_group_test_cluster_group",
-            "cluster_type_test_cluster_type",
-            "device_type_cisco_test",
-            "device_type_nexus_parent",
-            "is_virtual",
-            "manufacturer_cisco",
-            "rack_Test_Rack",
-            "rack_Test_Rack_Site_2",
-            "rack_role_test_rack_role",
-            "region_other_region",
-            "region_parent_region",
-            "role_core_switch",
-            "service_http",
-            "service_ssh",
-            "service_telnet",
-            "site_group_other_site_group",
-            "site_group_parent_site_group",
-            "site_test_site2",
-            "status_active",
-            "ungrouped"
-        ]
-    },
-    "cluster_Test_Cluster": {
-        "hosts": [
-            "test100",
-            "test100-vm",
-            "test101-vm",
-            "test102-vm",
-            "test103-vm"
-        ]
-    },
-    "cluster_Test_Cluster_2": {
-        "hosts": [
-            "Test VM With Spaces",
-            "test104-vm"
-        ]
-    },
-    "cluster_group_test_cluster_group": {
-        "hosts": [
-            "test100",
-            "test100-vm",
-            "test101-vm",
-            "test102-vm",
-            "test103-vm"
-        ]
-    },
-    "cluster_type_test_cluster_type": {
-        "hosts": [
-            "Test VM With Spaces",
-            "test100",
-            "test100-vm",
-            "test101-vm",
-            "test102-vm",
-            "test103-vm",
-            "test104-vm"
-        ]
-    },
-    "device_type_cisco_test": {
-        "hosts": [
-            "R1-Device",
-            "TestDeviceR1",
-            "test100"
-        ]
-    },
-    "device_type_nexus_parent": {
-        "hosts": [
-            "Test Nexus One"
-        ]
-    },
-    "is_virtual": {
-        "hosts": [
-            "Test VM With Spaces",
-            "test100-vm",
-            "test101-vm",
-            "test102-vm",
-            "test103-vm",
-            "test104-vm"
-        ]
-    },
-    "location_parent_rack_group": {
-        "children": [
-            "location_test_rack_group"
-        ]
-    },
-    "location_test_rack_group": {
-        "hosts": [
-            "Test Nexus One",
-            "TestDeviceR1",
-            "test100"
-        ]
-    },
-    "manufacturer_cisco": {
-        "hosts": [
-            "R1-Device",
-            "Test Nexus One",
-            "TestDeviceR1",
-            "test100"
-        ]
-    },
-    "rack_Test_Rack": {
-        "hosts": [
-            "TestDeviceR1"
-        ]
-    },
-    "rack_Test_Rack_Site_2": {
-        "hosts": [
-            "R1-Device"
-        ]
-    },
-    "rack_role_test_rack_role": {
-        "hosts": [
-            "R1-Device"
-        ]
-    },
-    "region_parent_region": {
-        "children": [
-            "region_test_region"
-        ]
-    },
-    "region_test_region": {
-        "children": [
-            "site_test_site"
-        ]
-    },
-    "role_core_switch": {
-        "hosts": [
-            "R1-Device",
-            "Test Nexus One",
-            "TestDeviceR1",
-            "test100"
-        ]
-    },
-    "service_http": {
-        "hosts": [
-            "test100"
-        ]
-    },
-    "service_ssh": {
-        "hosts": [
-            "Test VM With Spaces",
-            "test100"
-        ]
-    },
-    "service_telnet": {
-        "hosts": [
-            "Test Nexus One"
-        ]
-    },
-    "site_group_parent_site_group": {
-        "children": [
-            "site_group_test_site_group"
-        ]
-    },
-    "site_test_site": {
-        "children": [
-            "location_parent_rack_group"
-        ],
-        "hosts": [
-            "test100-vm",
-            "test101-vm",
-            "test102-vm",
-            "test103-vm"
-        ]
-    },
-    "site_test_site2": {
-        "hosts": [
-            "R1-Device"
-        ]
-    },
-    "status_active": {
-        "hosts": [
-            "R1-Device",
-            "Test Nexus One",
-            "Test VM With Spaces",
-            "TestDeviceR1",
-            "test100",
-            "test100-vm",
-            "test101-vm",
-            "test102-vm",
-            "test103-vm",
-            "test104-vm"
-        ]
-    }
-}
\ No newline at end of file
diff --git a/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json
index 74f43d76a..7246c683b 100644
--- a/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json
+++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json
@@ -153,7 +153,7 @@
                         "display": "Ethernet1/1",
                         "duplex": null,
                         "enabled": true,
-                        "id": 2,
+                        "id": 1,
                         "ip_addresses": [
                             {
                                 "address": "172.16.180.11/24",

From a01d37dc337e77fe1bebe81c2454dcb829c30a28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Kaster?= <joern.kaster@epg.com>
Date: Mon, 19 Feb 2024 13:37:40 +0100
Subject: [PATCH 15/15] cleanup for pulling

---
 .gitignore | 2 --
 install.sh | 5 -----
 2 files changed, 7 deletions(-)
 delete mode 100755 install.sh

diff --git a/.gitignore b/.gitignore
index 8fbabbd53..a7035db33 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,8 +8,6 @@ venv/
 changelogs/.plugin-cache.yaml
 docs/_build/*
 .python-version
-inventory/
-ansible.yml
 
 # https://github.com/ansible/ansible/issues/68499
 # ansible_collections/
diff --git a/install.sh b/install.sh
deleted file mode 100755
index 9a047895d..000000000
--- a/install.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-rm netbox-netbox-3.16.0.tar.gz
-ansible-galaxy collection build .
-ansible-galaxy collection install -f netbox-netbox-3.16.0.tar.gz
\ No newline at end of file