diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fccb40655..03a827362 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -76,12 +76,12 @@ jobs: fail-fast: false matrix: include: - - VERSION: "v3.4" - NETBOX_DOCKER_VERSION: 2.5.3 - VERSION: "v3.5" NETBOX_DOCKER_VERSION: 2.6.1 - VERSION: "v3.6" NETBOX_DOCKER_VERSION: 2.7.0 + - VERSION: "v3.7" + NETBOX_DOCKER_VERSION: 2.7.0 # If we want to integration test wiht all supported Python: #python-version: ["3.9", "3.10", "3.11"] diff --git a/tests/integration/targets/inventory-v3.4/.gitignore b/tests/integration/targets/inventory-v3.7/.gitignore similarity index 100% rename from tests/integration/targets/inventory-v3.4/.gitignore rename to tests/integration/targets/inventory-v3.7/.gitignore diff --git a/tests/integration/targets/inventory-v3.4/aliases b/tests/integration/targets/inventory-v3.7/aliases similarity index 100% rename from tests/integration/targets/inventory-v3.4/aliases rename to tests/integration/targets/inventory-v3.7/aliases diff --git a/tests/integration/targets/inventory-v3.4/compare_inventory_json.py b/tests/integration/targets/inventory-v3.7/compare_inventory_json.py similarity index 100% rename from tests/integration/targets/inventory-v3.4/compare_inventory_json.py rename to tests/integration/targets/inventory-v3.7/compare_inventory_json.py diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-bearer-token.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json similarity index 99% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-bearer-token.json rename to tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json index 1e52fdccd..360a7ac33 100644 --- a/tests/integration/targets/inventory-v3.4/files/test-inventory-bearer-token.json +++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.json @@ -2,6 +2,7 @@ "_meta": { "hostvars": { "R1-Device": { + "asset_tag": "345678901", "config_context": {}, "custom_fields": {}, "device_type": "cisco-test", @@ -13,6 +14,7 @@ "rack_role": "test-rack-role", "regions": [], "role": "core-switch", + "serial": "", "services": [], "site": "test-site2", "site_groups": [], @@ -20,9 +22,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "", - "asset_tag": "345678901" + "tags": [] }, "Test Nexus One": { "ansible_host": "172.16.180.12", @@ -260,6 +260,7 @@ "parent-region" ], "role": "core-switch", + "serial": "", "services": [ { "comments": "", @@ -291,8 +292,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "" + "tags": [] }, "Test VM With Spaces": { "cluster": "Test Cluster 2", @@ -405,6 +405,7 @@ "parent-region" ], "role": "core-switch", + "serial": "FAB12345678", "services": [], "site": "test-site", "site_groups": [], @@ -412,10 +413,10 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB12345678" + "tags": [] }, "test100": { + "asset_tag": "123456789", "config_context": { "ntp_servers": [ "pool.ntp.org" @@ -657,6 +658,7 @@ "parent-region" ], "role": "core-switch", + "serial": "FAB01234567", "services": [ { "comments": "", @@ -724,9 +726,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB01234567", - "asset_tag": "123456789" + "tags": [] }, "test100-vm": { "cluster": "Test Cluster", @@ -1099,28 +1099,28 @@ }, "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", + "ungrouped", + "site_test_site2", "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", + "rack_Test_Rack_Site_2", + "rack_role_test_rack_role", + "role_core_switch", + "device_type_cisco_test", + "manufacturer_cisco", "status_active", - "ungrouped" + "device_type_nexus_parent", + "service_telnet", + "rack_Test_Rack", + "service_ssh", + "service_http", + "cluster_Test_Cluster_2", + "cluster_type_test_cluster_type", + "is_virtual", + "cluster_Test_Cluster", + "cluster_group_test_cluster_group" ] }, "cluster_Test_Cluster": { @@ -1237,8 +1237,8 @@ }, "service_ssh": { "hosts": [ - "Test VM With Spaces", - "test100" + "test100", + "Test VM With Spaces" ] }, "service_telnet": { @@ -1252,14 +1252,14 @@ ] }, "site_test_site": { + "children": [ + "location_parent_rack_group" + ], "hosts": [ "test100-vm", "test101-vm", "test102-vm", "test103-vm" - ], - "children": [ - "location_parent_rack_group" ] }, "site_test_site2": { @@ -1271,9 +1271,9 @@ "hosts": [ "R1-Device", "Test Nexus One", - "Test VM With Spaces", "TestDeviceR1", "test100", + "Test VM With Spaces", "test100-vm", "test101-vm", "test102-vm", diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-bearer-token.yml b/tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.yml similarity index 100% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-bearer-token.yml rename to tests/integration/targets/inventory-v3.7/files/test-inventory-bearer-token.yml diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-jinja2-filter.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json similarity index 99% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-jinja2-filter.json rename to tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json index a03b0c505..6d7249836 100644 --- a/tests/integration/targets/inventory-v3.4/files/test-inventory-jinja2-filter.json +++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.json @@ -237,6 +237,7 @@ "parent-region" ], "role": "core-switch", + "serial": "", "services": [ { "comments": "", @@ -268,8 +269,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "" + "tags": [] }, "TestDeviceR1": { "config_context": {}, @@ -288,6 +288,7 @@ "parent-region" ], "role": "core-switch", + "serial": "FAB12345678", "services": [], "site": "test-site", "site_groups": [], @@ -295,10 +296,10 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB12345678" + "tags": [] }, "test100": { + "asset_tag": "123456789", "config_context": { "ntp_servers": [ "pool.ntp.org" @@ -540,6 +541,7 @@ "parent-region" ], "role": "core-switch", + "serial": "FAB01234567", "services": [ { "comments": "", @@ -607,9 +609,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB01234567", - "asset_tag": "123456789" + "tags": [] }, "test100-vm": { "cluster": "Test Cluster", @@ -965,25 +965,25 @@ }, "all": { "children": [ - "cluster_Test_Cluster", - "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", + "ungrouped", + "site_test_site2", "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", + "role_core_switch", + "device_type_nexus_parent", + "manufacturer_cisco", + "service_telnet", "status_active", - "ungrouped" + "rack_Test_Rack", + "device_type_cisco_test", + "service_ssh", + "service_http", + "cluster_Test_Cluster", + "cluster_group_test_cluster_group", + "cluster_type_test_cluster_type", + "is_virtual" ] }, "cluster_Test_Cluster": { @@ -1010,14 +1010,6 @@ "test103-vm" ] }, - "is_virtual": { - "hosts": [ - "test100-vm", - "test101-vm", - "test102-vm", - "test103-vm" - ] - }, "device_type_cisco_test": { "hosts": [ "TestDeviceR1", @@ -1029,6 +1021,14 @@ "Test Nexus One" ] }, + "is_virtual": { + "hosts": [ + "test100-vm", + "test101-vm", + "test102-vm", + "test103-vm" + ] + }, "location_parent_rack_group": { "children": [ "location_test_rack_group" @@ -1091,14 +1091,14 @@ ] }, "site_test_site": { + "children": [ + "location_parent_rack_group" + ], "hosts": [ "test100-vm", "test101-vm", "test102-vm", "test103-vm" - ], - "children": [ - "location_parent_rack_group" ] }, "status_active": { diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-jinja2-filter.yml b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.yml similarity index 100% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-jinja2-filter.yml rename to tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2-filter.yml diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-jinja2.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.json similarity index 96% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-jinja2.json rename to tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.json index b46c5e186..119e5633d 100644 --- a/tests/integration/targets/inventory-v3.4/files/test-inventory-jinja2.json +++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.json @@ -26,6 +26,7 @@ "_meta": { "hostvars": { "R1-Device": { + "asset_tag": "345678901", "custom_fields": {}, "device_type": "cisco-test", "is_virtual": false, @@ -36,15 +37,14 @@ "rack_role": "test-rack-role", "regions": [], "role": "core-switch", + "serial": "", "site": "test-site2", "site_groups": [], "status": { "label": "Active", "value": "active" }, - "tags": [], - "serial": "", - "asset_tag": "345678901" + "tags": [] }, "Test VM With Spaces": { "cluster": "Test Cluster 2", @@ -76,14 +76,14 @@ "parent-region" ], "role": "core-switch", + "serial": "FAB12345678", "site": "test-site", "site_groups": [], "status": { "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB12345678" + "tags": [] }, "VC1": { "ansible_host": "nexus.example.com", @@ -102,16 +102,17 @@ "parent-region" ], "role": "core-switch", + "serial": "", "site": "test-site", "site_groups": [], "status": { "label": "Active", "value": "active" }, - "tags": [], - "serial": "" + "tags": [] }, "test100": { + "asset_tag": "123456789", "custom_fields": {}, "device_type": "cisco-test", "is_virtual": false, @@ -130,15 +131,14 @@ "parent-region" ], "role": "core-switch", + "serial": "FAB01234567", "site": "test-site", "site_groups": [], "status": { "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB01234567", - "asset_tag": "123456789" + "tags": [] }, "test100-vm": { "cluster": "Test Cluster", @@ -235,10 +235,10 @@ "active": { "hosts": [ "R1-Device", - "Test VM With Spaces", - "TestDeviceR1", "VC1", + "TestDeviceR1", "test100", + "Test VM With Spaces", "test100-vm", "test101-vm", "test102-vm", @@ -248,33 +248,33 @@ }, "all": { "children": [ - "Test_Cluster", - "Test_Cluster_2", - "Test_Rack", - "Test_Rack_Site_2", - "active", - "cisco", - "cisco_test", - "core_switch", - "is_virtual", - "jinja_test_group", - "nexus_parent", + "ungrouped", + "test_site2", "other_region", - "other_site_group", "parent_region", + "other_site_group", "parent_site_group", - "test_cluster_group", - "test_cluster_type", + "Test_Rack_Site_2", "test_rack_role", - "test_site2", - "ungrouped" + "core_switch", + "cisco_test", + "cisco", + "active", + "nexus_parent", + "jinja_test_group", + "Test_Rack", + "Test_Cluster_2", + "test_cluster_type", + "is_virtual", + "Test_Cluster", + "test_cluster_group" ] }, "cisco": { "hosts": [ "R1-Device", - "TestDeviceR1", "VC1", + "TestDeviceR1", "test100" ] }, @@ -288,8 +288,8 @@ "core_switch": { "hosts": [ "R1-Device", - "TestDeviceR1", "VC1", + "TestDeviceR1", "test100" ] }, @@ -305,8 +305,8 @@ }, "jinja_test_group": { "hosts": [ - "Test VM With Spaces", - "TestDeviceR1" + "TestDeviceR1", + "Test VM With Spaces" ] }, "nexus_parent": { @@ -349,8 +349,8 @@ }, "test_rack_group": { "hosts": [ - "TestDeviceR1", "VC1", + "TestDeviceR1", "test100" ] }, @@ -365,14 +365,14 @@ ] }, "test_site": { + "children": [ + "parent_rack_group" + ], "hosts": [ "test100-vm", "test101-vm", "test102-vm", "test103-vm" - ], - "children": [ - "parent_rack_group" ] }, "test_site2": { diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-jinja2.yml b/tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.yml similarity index 100% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-jinja2.yml rename to tests/integration/targets/inventory-v3.7/files/test-inventory-jinja2.yml diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-legacy.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.json similarity index 98% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-legacy.json rename to tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.json index 3ab35ce44..6df5dbf2b 100644 --- a/tests/integration/targets/inventory-v3.4/files/test-inventory-legacy.json +++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.json @@ -2,6 +2,7 @@ "_meta": { "hostvars": { "R1-Device": { + "asset_tag": "345678901", "custom_fields": {}, "device_roles": [ "core-switch" @@ -22,6 +23,7 @@ "Test Rack Site 2" ], "regions": [], + "serial": "", "services": [], "site_groups": [], "sites": [ @@ -31,9 +33,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "", - "asset_tag": "345678901" + "tags": [] }, "Test Nexus One": { "ansible_host": "172.16.180.12", @@ -60,6 +60,7 @@ "test-region", "parent-region" ], + "serial": "", "services": [ { "comments": "", @@ -93,8 +94,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "" + "tags": [] }, "Test VM With Spaces": { "cluster": "Test Cluster 2", @@ -164,6 +164,7 @@ "test-region", "parent-region" ], + "serial": "FAB12345678", "services": [], "site_groups": [], "sites": [ @@ -173,10 +174,10 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB12345678" + "tags": [] }, "test100": { + "asset_tag": "123456789", "custom_fields": {}, "device_roles": [ "core-switch" @@ -203,6 +204,7 @@ "test-region", "parent-region" ], + "serial": "FAB01234567", "services": [ { "comments": "", @@ -272,9 +274,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB01234567", - "asset_tag": "123456789" + "tags": [] }, "test100-vm": { "cluster": "Test Cluster", @@ -291,10 +291,10 @@ "parent-region" ], "services": [], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -316,10 +316,10 @@ "parent-region" ], "services": [], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -341,10 +341,10 @@ "parent-region" ], "services": [], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -366,10 +366,10 @@ "parent-region" ], "services": [], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -405,9 +405,9 @@ "hosts": [ "R1-Device", "Test Nexus One", - "Test VM With Spaces", "TestDeviceR1", "test100", + "Test VM With Spaces", "test100-vm", "test101-vm", "test102-vm", diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-legacy.yml b/tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.yml similarity index 100% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-legacy.yml rename to tests/integration/targets/inventory-v3.7/files/test-inventory-legacy.yml diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-noracks.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.json similarity index 99% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-noracks.json rename to tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.json index a97af7a61..b61454e00 100644 --- a/tests/integration/targets/inventory-v3.4/files/test-inventory-noracks.json +++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.json @@ -2,6 +2,7 @@ "_meta": { "hostvars": { "R1-Device": { + "asset_tag": "345678901", "config_context": [ {} ], @@ -21,6 +22,7 @@ "cisco" ], "regions": [], + "serial": "", "services": [], "site_groups": [], "sites": [ @@ -30,9 +32,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "", - "asset_tag": "345678901" + "tags": [] }, "Test Nexus One": { "ansible_host": "172.16.180.12", @@ -277,6 +277,7 @@ "test-region", "parent-region" ], + "serial": "", "services": [ { "comments": "", @@ -310,8 +311,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "" + "tags": [] }, "Test VM With Spaces": { "cluster": "Test Cluster 2", @@ -434,6 +434,7 @@ "test-region", "parent-region" ], + "serial": "FAB12345678", "services": [], "site_groups": [], "sites": [ @@ -443,10 +444,10 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB12345678" + "tags": [] }, "test100": { + "asset_tag": "123456789", "config_context": [ { "ntp_servers": [ @@ -694,6 +695,7 @@ "test-region", "parent-region" ], + "serial": "FAB01234567", "services": [ { "comments": "", @@ -763,9 +765,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB01234567", - "asset_tag": "123456789" + "tags": [] }, "test100-vm": { "cluster": "Test Cluster", @@ -916,10 +916,10 @@ "parent-region" ], "services": [], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -1075,10 +1075,10 @@ "parent-region" ], "services": [], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -1103,10 +1103,10 @@ "parent-region" ], "services": [], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -1131,10 +1131,10 @@ "parent-region" ], "services": [], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -1166,22 +1166,22 @@ }, "all": { "children": [ - "cluster_Test_Cluster", - "cluster_Test_Cluster_2", - "cluster_group_test_cluster_group", - "cluster_type_test_cluster_type", - "device_roles_core_switch", - "device_types_cisco_test", - "device_types_nexus_parent", - "is_virtual", - "manufacturers_cisco", + "ungrouped", + "sites_test_site2", "region_other_region", "region_parent_region", "site_group_other_site_group", "site_group_parent_site_group", - "sites_test_site2", + "device_roles_core_switch", + "device_types_cisco_test", + "manufacturers_cisco", "status_active", - "ungrouped" + "device_types_nexus_parent", + "cluster_Test_Cluster_2", + "cluster_type_test_cluster_type", + "is_virtual", + "cluster_Test_Cluster", + "cluster_group_test_cluster_group" ] }, "cluster_Test_Cluster": { @@ -1282,14 +1282,14 @@ ] }, "sites_test_site": { + "children": [ + "location_parent_rack_group" + ], "hosts": [ "test100-vm", "test101-vm", "test102-vm", "test103-vm" - ], - "children": [ - "location_parent_rack_group" ] }, "sites_test_site2": { @@ -1301,9 +1301,9 @@ "hosts": [ "R1-Device", "Test Nexus One", - "Test VM With Spaces", "TestDeviceR1", "test100", + "Test VM With Spaces", "test100-vm", "test101-vm", "test102-vm", diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-noracks.yml b/tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.yml similarity index 100% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-noracks.yml rename to tests/integration/targets/inventory-v3.7/files/test-inventory-noracks.yml diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-options-flatten.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.json similarity index 99% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-options-flatten.json rename to tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.json index 919c32c8c..8e019bd84 100644 --- a/tests/integration/targets/inventory-v3.4/files/test-inventory-options-flatten.json +++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.json @@ -26,6 +26,7 @@ "_meta": { "hostvars": { "R1-Device": { + "asset_tag": "345678901", "device_type": "cisco-test", "interfaces": [], "is_virtual": false, @@ -35,6 +36,7 @@ "rack_role": "test-rack-role", "regions": [], "role": "core-switch", + "serial": "", "services": [], "site": "test-site2", "site_groups": [], @@ -42,9 +44,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "", - "asset_tag": "345678901" + "tags": [] }, "Test Nexus One": { "ansible_host": "172.16.180.12", @@ -280,6 +280,7 @@ "parent-region" ], "role": "core-switch", + "serial": "", "services": [ { "comments": "", @@ -311,8 +312,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "" + "tags": [] }, "Test VM With Spaces": { "cluster": "Test Cluster 2", @@ -421,6 +421,7 @@ "parent-region" ], "role": "core-switch", + "serial": "FAB12345678", "services": [], "site": "test-site", "site_groups": [], @@ -428,10 +429,10 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB12345678" + "tags": [] }, "test100": { + "asset_tag": "123456789", "device_type": "cisco-test", "interfaces": [ { @@ -665,6 +666,7 @@ "parent-region" ], "role": "core-switch", + "serial": "FAB01234567", "services": [ { "comments": "", @@ -732,9 +734,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB01234567", - "asset_tag": "123456789" + "tags": [] }, "test100-vm": { "cluster": "Test Cluster", @@ -1099,9 +1099,9 @@ "hosts": [ "R1-Device", "Test Nexus One", - "Test VM With Spaces", "TestDeviceR1", "test100", + "Test VM With Spaces", "test100-vm", "test101-vm", "test102-vm", @@ -1111,25 +1111,25 @@ }, "all": { "children": [ - "Test_Cluster", - "Test_Cluster_2", - "Test_Rack", - "Test_Rack_Site_2", - "active", - "cisco", - "cisco_test", - "core_switch", - "is_virtual", - "nexus_parent", + "ungrouped", + "test_site2", "other_region", - "other_site_group", "parent_region", + "other_site_group", "parent_site_group", - "test_cluster_group", - "test_cluster_type", + "Test_Rack_Site_2", "test_rack_role", - "test_site2", - "ungrouped" + "core_switch", + "cisco_test", + "cisco", + "active", + "nexus_parent", + "Test_Rack", + "Test_Cluster_2", + "test_cluster_type", + "is_virtual", + "Test_Cluster", + "test_cluster_group" ] }, "cisco": { @@ -1221,14 +1221,14 @@ ] }, "test_site": { + "children": [ + "parent_rack_group" + ], "hosts": [ "test100-vm", "test101-vm", "test102-vm", "test103-vm" - ], - "children": [ - "parent_rack_group" ] }, "test_site2": { diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-options-flatten.yml b/tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.yml similarity index 100% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-options-flatten.yml rename to tests/integration/targets/inventory-v3.7/files/test-inventory-options-flatten.yml diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-options.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-options.json similarity index 96% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-options.json rename to tests/integration/targets/inventory-v3.7/files/test-inventory-options.json index b46c5e186..119e5633d 100644 --- a/tests/integration/targets/inventory-v3.4/files/test-inventory-options.json +++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-options.json @@ -26,6 +26,7 @@ "_meta": { "hostvars": { "R1-Device": { + "asset_tag": "345678901", "custom_fields": {}, "device_type": "cisco-test", "is_virtual": false, @@ -36,15 +37,14 @@ "rack_role": "test-rack-role", "regions": [], "role": "core-switch", + "serial": "", "site": "test-site2", "site_groups": [], "status": { "label": "Active", "value": "active" }, - "tags": [], - "serial": "", - "asset_tag": "345678901" + "tags": [] }, "Test VM With Spaces": { "cluster": "Test Cluster 2", @@ -76,14 +76,14 @@ "parent-region" ], "role": "core-switch", + "serial": "FAB12345678", "site": "test-site", "site_groups": [], "status": { "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB12345678" + "tags": [] }, "VC1": { "ansible_host": "nexus.example.com", @@ -102,16 +102,17 @@ "parent-region" ], "role": "core-switch", + "serial": "", "site": "test-site", "site_groups": [], "status": { "label": "Active", "value": "active" }, - "tags": [], - "serial": "" + "tags": [] }, "test100": { + "asset_tag": "123456789", "custom_fields": {}, "device_type": "cisco-test", "is_virtual": false, @@ -130,15 +131,14 @@ "parent-region" ], "role": "core-switch", + "serial": "FAB01234567", "site": "test-site", "site_groups": [], "status": { "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB01234567", - "asset_tag": "123456789" + "tags": [] }, "test100-vm": { "cluster": "Test Cluster", @@ -235,10 +235,10 @@ "active": { "hosts": [ "R1-Device", - "Test VM With Spaces", - "TestDeviceR1", "VC1", + "TestDeviceR1", "test100", + "Test VM With Spaces", "test100-vm", "test101-vm", "test102-vm", @@ -248,33 +248,33 @@ }, "all": { "children": [ - "Test_Cluster", - "Test_Cluster_2", - "Test_Rack", - "Test_Rack_Site_2", - "active", - "cisco", - "cisco_test", - "core_switch", - "is_virtual", - "jinja_test_group", - "nexus_parent", + "ungrouped", + "test_site2", "other_region", - "other_site_group", "parent_region", + "other_site_group", "parent_site_group", - "test_cluster_group", - "test_cluster_type", + "Test_Rack_Site_2", "test_rack_role", - "test_site2", - "ungrouped" + "core_switch", + "cisco_test", + "cisco", + "active", + "nexus_parent", + "jinja_test_group", + "Test_Rack", + "Test_Cluster_2", + "test_cluster_type", + "is_virtual", + "Test_Cluster", + "test_cluster_group" ] }, "cisco": { "hosts": [ "R1-Device", - "TestDeviceR1", "VC1", + "TestDeviceR1", "test100" ] }, @@ -288,8 +288,8 @@ "core_switch": { "hosts": [ "R1-Device", - "TestDeviceR1", "VC1", + "TestDeviceR1", "test100" ] }, @@ -305,8 +305,8 @@ }, "jinja_test_group": { "hosts": [ - "Test VM With Spaces", - "TestDeviceR1" + "TestDeviceR1", + "Test VM With Spaces" ] }, "nexus_parent": { @@ -349,8 +349,8 @@ }, "test_rack_group": { "hosts": [ - "TestDeviceR1", "VC1", + "TestDeviceR1", "test100" ] }, @@ -365,14 +365,14 @@ ] }, "test_site": { + "children": [ + "parent_rack_group" + ], "hosts": [ "test100-vm", "test101-vm", "test102-vm", "test103-vm" - ], - "children": [ - "parent_rack_group" ] }, "test_site2": { diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-options.yml b/tests/integration/targets/inventory-v3.7/files/test-inventory-options.yml similarity index 100% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-options.yml rename to tests/integration/targets/inventory-v3.7/files/test-inventory-options.yml diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-plurals-flatten.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.json similarity index 97% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-plurals-flatten.json rename to tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.json index 32e333a22..bf84ee743 100644 --- a/tests/integration/targets/inventory-v3.4/files/test-inventory-plurals-flatten.json +++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.json @@ -26,6 +26,7 @@ "_meta": { "hostvars": { "R1-Device": { + "asset_tag": "345678901", "device_roles": [ "core-switch" ], @@ -45,6 +46,7 @@ "Test Rack Site 2" ], "regions": [], + "serial": "", "site_groups": [], "sites": [ "test-site2" @@ -53,9 +55,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "", - "asset_tag": "345678901" + "tags": [] }, "Test Nexus One": { "ansible_host": "172.16.180.12", @@ -81,6 +81,7 @@ "test-region", "parent-region" ], + "serial": "", "site_groups": [], "sites": [ "test-site" @@ -89,8 +90,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "" + "tags": [] }, "Test VM With Spaces": { "cluster": "Test Cluster 2", @@ -133,6 +133,7 @@ "test-region", "parent-region" ], + "serial": "FAB12345678", "site_groups": [], "sites": [ "test-site" @@ -141,10 +142,10 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB12345678" + "tags": [] }, "test100": { + "asset_tag": "123456789", "device_roles": [ "core-switch" ], @@ -173,6 +174,7 @@ "test-region", "parent-region" ], + "serial": "FAB01234567", "site_groups": [], "sites": [ "test-site" @@ -181,9 +183,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB01234567", - "asset_tag": "123456789" + "tags": [] }, "test100-vm": { "cluster": "Test Cluster", @@ -198,10 +198,10 @@ "test-region", "parent-region" ], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -221,10 +221,10 @@ "test-region", "parent-region" ], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -244,10 +244,10 @@ "test-region", "parent-region" ], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -267,10 +267,10 @@ "test-region", "parent-region" ], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -299,9 +299,9 @@ "hosts": [ "R1-Device", "Test Nexus One", - "Test VM With Spaces", "TestDeviceR1", "test100", + "Test VM With Spaces", "test100-vm", "test101-vm", "test102-vm", @@ -311,25 +311,25 @@ }, "all": { "children": [ - "Test_Cluster", - "Test_Cluster_2", - "Test_Rack", - "Test_Rack_Site_2", - "active", - "cisco", - "cisco_test", - "core_switch", - "is_virtual", - "nexus_parent", + "ungrouped", + "test_site2", "other_region", - "other_site_group", "parent_region", + "other_site_group", "parent_site_group", - "test_cluster_group", - "test_cluster_type", + "Test_Rack_Site_2", "test_rack_role", - "test_site2", - "ungrouped" + "core_switch", + "cisco_test", + "cisco", + "active", + "nexus_parent", + "Test_Rack", + "Test_Cluster_2", + "test_cluster_type", + "is_virtual", + "Test_Cluster", + "test_cluster_group" ] }, "cisco": { @@ -421,14 +421,14 @@ ] }, "test_site": { + "children": [ + "parent_rack_group" + ], "hosts": [ "test100-vm", "test101-vm", "test102-vm", "test103-vm" - ], - "children": [ - "parent_rack_group" ] }, "test_site2": { diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-plurals-flatten.yml b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.yml similarity index 100% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-plurals-flatten.yml rename to tests/integration/targets/inventory-v3.7/files/test-inventory-plurals-flatten.yml diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-plurals.json b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json similarity index 99% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-plurals.json rename to tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json index 63dd962ce..22f9d4e5f 100644 --- a/tests/integration/targets/inventory-v3.4/files/test-inventory-plurals.json +++ b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.json @@ -2,6 +2,7 @@ "_meta": { "hostvars": { "R1-Device": { + "asset_tag": "345678901", "config_context": [ {} ], @@ -26,6 +27,7 @@ "Test Rack Site 2" ], "regions": [], + "serial": "", "services": [], "site_groups": [], "sites": [ @@ -35,9 +37,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "", - "asset_tag": "345678901" + "tags": [] }, "Test Nexus One": { "ansible_host": "172.16.180.12", @@ -286,6 +286,7 @@ "test-region", "parent-region" ], + "serial": "", "services": [ { "comments": "", @@ -319,8 +320,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "" + "tags": [] }, "Test VM With Spaces": { "cluster": "Test Cluster 2", @@ -451,6 +451,7 @@ "test-region", "parent-region" ], + "serial": "FAB12345678", "services": [], "site_groups": [], "sites": [ @@ -460,10 +461,10 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB12345678" + "tags": [] }, "test100": { + "asset_tag": "123456789", "config_context": [ { "ntp_servers": [ @@ -715,6 +716,7 @@ "test-region", "parent-region" ], + "serial": "FAB01234567", "services": [ { "comments": "", @@ -784,9 +786,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB01234567", - "asset_tag": "123456789" + "tags": [] }, "test100-vm": { "cluster": "Test Cluster", @@ -938,10 +938,10 @@ "parent-region" ], "services": [], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -1098,10 +1098,10 @@ "parent-region" ], "services": [], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -1127,10 +1127,10 @@ "parent-region" ], "services": [], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -1156,10 +1156,10 @@ "parent-region" ], "services": [], + "site_groups": [], "sites": [ "test-site" ], - "site_groups": [], "status": { "label": "Active", "value": "active" @@ -1192,25 +1192,25 @@ }, "all": { "children": [ - "cluster_Test_Cluster", - "cluster_Test_Cluster_2", - "cluster_group_test_cluster_group", - "cluster_type_test_cluster_type", - "device_roles_core_switch", - "device_types_cisco_test", - "device_types_nexus_parent", - "is_virtual", - "manufacturers_cisco", - "rack_role_test_rack_role", - "racks_Test_Rack", - "racks_Test_Rack_Site_2", + "ungrouped", + "sites_test_site2", "region_other_region", "region_parent_region", "site_group_other_site_group", "site_group_parent_site_group", - "sites_test_site2", + "racks_Test_Rack_Site_2", + "rack_role_test_rack_role", + "device_roles_core_switch", + "device_types_cisco_test", + "manufacturers_cisco", "status_active", - "ungrouped" + "device_types_nexus_parent", + "racks_Test_Rack", + "cluster_Test_Cluster_2", + "cluster_type_test_cluster_type", + "is_virtual", + "cluster_Test_Cluster", + "cluster_group_test_cluster_group" ] }, "cluster_Test_Cluster": { @@ -1326,14 +1326,14 @@ ] }, "sites_test_site": { + "children": [ + "location_parent_rack_group" + ], "hosts": [ "test100-vm", "test101-vm", "test102-vm", "test103-vm" - ], - "children": [ - "location_parent_rack_group" ] }, "sites_test_site2": { @@ -1345,9 +1345,9 @@ "hosts": [ "R1-Device", "Test Nexus One", - "Test VM With Spaces", "TestDeviceR1", "test100", + "Test VM With Spaces", "test100-vm", "test101-vm", "test102-vm", diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory-plurals.yml b/tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.yml similarity index 100% rename from tests/integration/targets/inventory-v3.4/files/test-inventory-plurals.yml rename to tests/integration/targets/inventory-v3.7/files/test-inventory-plurals.yml diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory.json b/tests/integration/targets/inventory-v3.7/files/test-inventory.json similarity index 99% rename from tests/integration/targets/inventory-v3.4/files/test-inventory.json rename to tests/integration/targets/inventory-v3.7/files/test-inventory.json index 1e52fdccd..360a7ac33 100644 --- a/tests/integration/targets/inventory-v3.4/files/test-inventory.json +++ b/tests/integration/targets/inventory-v3.7/files/test-inventory.json @@ -2,6 +2,7 @@ "_meta": { "hostvars": { "R1-Device": { + "asset_tag": "345678901", "config_context": {}, "custom_fields": {}, "device_type": "cisco-test", @@ -13,6 +14,7 @@ "rack_role": "test-rack-role", "regions": [], "role": "core-switch", + "serial": "", "services": [], "site": "test-site2", "site_groups": [], @@ -20,9 +22,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "", - "asset_tag": "345678901" + "tags": [] }, "Test Nexus One": { "ansible_host": "172.16.180.12", @@ -260,6 +260,7 @@ "parent-region" ], "role": "core-switch", + "serial": "", "services": [ { "comments": "", @@ -291,8 +292,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "" + "tags": [] }, "Test VM With Spaces": { "cluster": "Test Cluster 2", @@ -405,6 +405,7 @@ "parent-region" ], "role": "core-switch", + "serial": "FAB12345678", "services": [], "site": "test-site", "site_groups": [], @@ -412,10 +413,10 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB12345678" + "tags": [] }, "test100": { + "asset_tag": "123456789", "config_context": { "ntp_servers": [ "pool.ntp.org" @@ -657,6 +658,7 @@ "parent-region" ], "role": "core-switch", + "serial": "FAB01234567", "services": [ { "comments": "", @@ -724,9 +726,7 @@ "label": "Active", "value": "active" }, - "tags": [], - "serial": "FAB01234567", - "asset_tag": "123456789" + "tags": [] }, "test100-vm": { "cluster": "Test Cluster", @@ -1099,28 +1099,28 @@ }, "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", + "ungrouped", + "site_test_site2", "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", + "rack_Test_Rack_Site_2", + "rack_role_test_rack_role", + "role_core_switch", + "device_type_cisco_test", + "manufacturer_cisco", "status_active", - "ungrouped" + "device_type_nexus_parent", + "service_telnet", + "rack_Test_Rack", + "service_ssh", + "service_http", + "cluster_Test_Cluster_2", + "cluster_type_test_cluster_type", + "is_virtual", + "cluster_Test_Cluster", + "cluster_group_test_cluster_group" ] }, "cluster_Test_Cluster": { @@ -1237,8 +1237,8 @@ }, "service_ssh": { "hosts": [ - "Test VM With Spaces", - "test100" + "test100", + "Test VM With Spaces" ] }, "service_telnet": { @@ -1252,14 +1252,14 @@ ] }, "site_test_site": { + "children": [ + "location_parent_rack_group" + ], "hosts": [ "test100-vm", "test101-vm", "test102-vm", "test103-vm" - ], - "children": [ - "location_parent_rack_group" ] }, "site_test_site2": { @@ -1271,9 +1271,9 @@ "hosts": [ "R1-Device", "Test Nexus One", - "Test VM With Spaces", "TestDeviceR1", "test100", + "Test VM With Spaces", "test100-vm", "test101-vm", "test102-vm", diff --git a/tests/integration/targets/inventory-v3.4/files/test-inventory.yml b/tests/integration/targets/inventory-v3.7/files/test-inventory.yml similarity index 100% rename from tests/integration/targets/inventory-v3.4/files/test-inventory.yml rename to tests/integration/targets/inventory-v3.7/files/test-inventory.yml diff --git a/tests/integration/targets/inventory-v3.4/runme.sh b/tests/integration/targets/inventory-v3.7/runme.sh similarity index 98% rename from tests/integration/targets/inventory-v3.4/runme.sh rename to tests/integration/targets/inventory-v3.7/runme.sh index 2d2943061..18579c472 100755 --- a/tests/integration/targets/inventory-v3.4/runme.sh +++ b/tests/integration/targets/inventory-v3.7/runme.sh @@ -19,7 +19,7 @@ fi declare -a COMPARE_OPTIONS # empty array # Check if NETBOX_VERSION has been set by runme_config, and if so, pass to compare_inventory_json.py -if [[ "${NETBOX_VERSION:-}" == "v3.4" ]] +if [[ "${NETBOX_VERSION:-}" == "v3.5" ]] then COMPARE_OPTIONS+=(--netbox-version "${NETBOX_VERSION}") fi diff --git a/tests/integration/targets/inventory-v3.4/runme_config.template b/tests/integration/targets/inventory-v3.7/runme_config.template similarity index 100% rename from tests/integration/targets/inventory-v3.4/runme_config.template rename to tests/integration/targets/inventory-v3.7/runme_config.template diff --git a/tests/integration/targets/regression-v3.4/tasks/main.yml b/tests/integration/targets/regression-v3.7/tasks/main.yml similarity index 100% rename from tests/integration/targets/regression-v3.4/tasks/main.yml rename to tests/integration/targets/regression-v3.7/tasks/main.yml diff --git a/tests/integration/targets/v3.4/tasks/main.yml b/tests/integration/targets/v3.7/tasks/main.yml similarity index 91% rename from tests/integration/targets/v3.4/tasks/main.yml rename to tests/integration/targets/v3.7/tasks/main.yml index 38aa7d0ff..a00139f83 100644 --- a/tests/integration/targets/v3.4/tasks/main.yml +++ b/tests/integration/targets/v3.7/tasks/main.yml @@ -1,5 +1,4 @@ --- - - name: "NETBOX_DEVICE TESTS" include_tasks: "netbox_device.yml" @@ -229,32 +228,33 @@ tags: - netbox_export_template -- name: "NETBOX_WEBHOOK TESTS" - include_tasks: - file: "netbox_webhook.yml" - apply: - tags: - - netbox_webhook - tags: - - netbox_webhook - -- name: "NETBOX_L2VPN TESTS" - include_tasks: - file: "netbox_l2vpn.yml" - apply: - tags: - - netbox_l2vpn - tags: - - netbox_l2vpn - -- name: "NETBOX_L2VPN_TERMINATION TESTS" - include_tasks: - file: "netbox_l2vpn_termination.yml" - apply: - tags: - - netbox_l2vpn_termination - tags: - - netbox_l2vpn_termination +# Must update for 3.7 +#- name: "NETBOX_WEBHOOK TESTS" +# include_tasks: +# file: "netbox_webhook.yml" +# apply: +# tags: +# - netbox_webhook +# tags: +# - netbox_webhook + +#- name: "NETBOX_L2VPN TESTS" +# include_tasks: +# file: "netbox_l2vpn.yml" +# apply: +# tags: +# - netbox_l2vpn +# tags: +# - netbox_l2vpn + +#- name: "NETBOX_L2VPN_TERMINATION TESTS" +# include_tasks: +# file: "netbox_l2vpn_termination.yml" +# apply: +# tags: +# - netbox_l2vpn_termination +# tags: +# - netbox_l2vpn_termination - name: "NETBOX_INVENTORY_ITEM_ROLE TESTS" include_tasks: @@ -306,3 +306,8 @@ - netbox_fhrp_group_assignmen tags: - netbox_fhrp_group_assignmen + +- name: "NETBOX_CONFIG_TEMPLATE" + include_tasks: "netbox_config_template.yml" + tags: + - netbox_config_template diff --git a/tests/integration/targets/v3.4/tasks/netbox_aggregate.yml b/tests/integration/targets/v3.7/tasks/netbox_aggregate.yml similarity index 97% rename from tests/integration/targets/v3.4/tasks/netbox_aggregate.yml rename to tests/integration/targets/v3.7/tasks/netbox_aggregate.yml index 8fbd2b7dd..ac02641dc 100644 --- a/tests/integration/targets/v3.4/tasks/netbox_aggregate.yml +++ b/tests/integration/targets/v3.7/tasks/netbox_aggregate.yml @@ -21,7 +21,7 @@ - test_one['diff']['before']['state'] == "absent" - test_one['diff']['after']['state'] == "present" - test_one['aggregate']['prefix'] == "10.0.0.0/8" - - test_one['aggregate']['family'] == 4 + #- test_one['aggregate']['family'] == 4 - test_one['aggregate']['rir'] == 1 - test_one['msg'] == "aggregate 10.0.0.0/8 created" @@ -110,6 +110,6 @@ - test_five['diff']['before']['state'] == "absent" - test_five['diff']['after']['state'] == "present" - test_five['aggregate']['prefix'] == "2001::/32" - - test_five['aggregate']['family'] == 6 + #- test_five['aggregate']['family'] == 6 - test_five['aggregate']['rir'] == 1 - test_five['msg'] == "aggregate 2001::/32 created" diff --git a/tests/integration/targets/v3.4/tasks/netbox_asn.yml b/tests/integration/targets/v3.7/tasks/netbox_asn.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_asn.yml rename to tests/integration/targets/v3.7/tasks/netbox_asn.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_cable.yml b/tests/integration/targets/v3.7/tasks/netbox_cable.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_cable.yml rename to tests/integration/targets/v3.7/tasks/netbox_cable.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_circuit.yml b/tests/integration/targets/v3.7/tasks/netbox_circuit.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_circuit.yml rename to tests/integration/targets/v3.7/tasks/netbox_circuit.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_circuit_termination.yml b/tests/integration/targets/v3.7/tasks/netbox_circuit_termination.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_circuit_termination.yml rename to tests/integration/targets/v3.7/tasks/netbox_circuit_termination.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_circuit_type.yml b/tests/integration/targets/v3.7/tasks/netbox_circuit_type.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_circuit_type.yml rename to tests/integration/targets/v3.7/tasks/netbox_circuit_type.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_cluster.yml b/tests/integration/targets/v3.7/tasks/netbox_cluster.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_cluster.yml rename to tests/integration/targets/v3.7/tasks/netbox_cluster.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_cluster_group.yml b/tests/integration/targets/v3.7/tasks/netbox_cluster_group.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_cluster_group.yml rename to tests/integration/targets/v3.7/tasks/netbox_cluster_group.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_cluster_type.yml b/tests/integration/targets/v3.7/tasks/netbox_cluster_type.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_cluster_type.yml rename to tests/integration/targets/v3.7/tasks/netbox_cluster_type.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_config_context.yml b/tests/integration/targets/v3.7/tasks/netbox_config_context.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_config_context.yml rename to tests/integration/targets/v3.7/tasks/netbox_config_context.yml diff --git a/tests/integration/targets/v3.7/tasks/netbox_config_template.yml b/tests/integration/targets/v3.7/tasks/netbox_config_template.yml new file mode 100644 index 000000000..9abf3ea05 --- /dev/null +++ b/tests/integration/targets/v3.7/tasks/netbox_config_template.yml @@ -0,0 +1,82 @@ +--- +## +## +### NETBOX_CONFIG_TEMPLATES +## +## +- name: "CONFIG_TEMPLATES 1: Necessary info creation" + netbox.netbox.netbox_config_template: + netbox_url: http://localhost:32768 + netbox_token: 0123456789abcdef0123456789abcdef01234567 + data: + name: "test_template" + description: "Test template" + template_code: "test template" + state: present + register: test_one + +- name: "CONFIG_TEMPLATES 1: ASSERT - Necessary info creation" + assert: + that: + - test_one is changed + - test_one['diff']['before']['state'] == "absent" + - test_one['diff']['after']['state'] == "present" + - test_one['config_template']['name'] == "test_template" + - test_one['config_template']['description'] == "Test template" + - test_one['config_template']['template_code'] == "test template" + - test_one['msg'] == "config_template test_template created" + +- name: "CONFIG_TEMPLATES 2: Create duplicate" + netbox.netbox.netbox_config_template: + netbox_url: http://localhost:32768 + netbox_token: 0123456789abcdef0123456789abcdef01234567 + data: + name: "test_template" + description: "Test template" + template_code: "test template" + state: present + register: test_two + +- name: "CONFIG_TEMPLATES 2: ASSERT - Create duplicate" + assert: + that: + - not test_two['changed'] + - test_two['config_template']['name'] == "test_template" + - test_two['msg'] == "config_template test_template already exists" + +- name: "CONFIG_TEMPLATES 3: Update data" + netbox.netbox.netbox_config_template: + netbox_url: http://localhost:32768 + netbox_token: 0123456789abcdef0123456789abcdef01234567 + data: + name: "test_template" + description: "Updated test template" + template_code: "updated test template" + state: present + register: test_three + +- name: "CONFIG_TEMPLATES 3: ASSERT - Updated" + assert: + that: + - test_three is changed + - test_three['diff']['after']['template_code'] == "updated test template" + - test_three['diff']['after']['description'] == "Updated test template" + - test_three['config_template']['name'] == "test_template" + - test_three['msg'] == "config_template test_template updated" + +- name: "CONFIG_TEMPLATES 4: Delete" + netbox.netbox.netbox_config_template: + netbox_url: http://localhost:32768 + netbox_token: 0123456789abcdef0123456789abcdef01234567 + data: + name: "test_template" + state: absent + register: test_four + +- name: "CONFIG_TEMPLATES 4: ASSERT - Deleted" + assert: + that: + - test_four is changed + - test_four['diff']['after']['state'] == "absent" + - test_four['config_template']['name'] == "test_template" + - test_four['msg'] == "config_template test_template deleted" diff --git a/tests/integration/targets/v3.4/tasks/netbox_console_port.yml b/tests/integration/targets/v3.7/tasks/netbox_console_port.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_console_port.yml rename to tests/integration/targets/v3.7/tasks/netbox_console_port.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_console_port_template.yml b/tests/integration/targets/v3.7/tasks/netbox_console_port_template.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_console_port_template.yml rename to tests/integration/targets/v3.7/tasks/netbox_console_port_template.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_console_server_port.yml b/tests/integration/targets/v3.7/tasks/netbox_console_server_port.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_console_server_port.yml rename to tests/integration/targets/v3.7/tasks/netbox_console_server_port.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_console_server_port_template.yml b/tests/integration/targets/v3.7/tasks/netbox_console_server_port_template.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_console_server_port_template.yml rename to tests/integration/targets/v3.7/tasks/netbox_console_server_port_template.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_contact.yml b/tests/integration/targets/v3.7/tasks/netbox_contact.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_contact.yml rename to tests/integration/targets/v3.7/tasks/netbox_contact.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_contact_role.yml b/tests/integration/targets/v3.7/tasks/netbox_contact_role.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_contact_role.yml rename to tests/integration/targets/v3.7/tasks/netbox_contact_role.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_custom_field.yml b/tests/integration/targets/v3.7/tasks/netbox_custom_field.yml similarity index 84% rename from tests/integration/targets/v3.4/tasks/netbox_custom_field.yml rename to tests/integration/targets/v3.7/tasks/netbox_custom_field.yml index 0db0b5e1a..7b8525e8e 100644 --- a/tests/integration/targets/v3.4/tasks/netbox_custom_field.yml +++ b/tests/integration/targets/v3.7/tasks/netbox_custom_field.yml @@ -106,3 +106,24 @@ - test_five['diff']['after']['state'] == "absent" - test_five['custom_field']['name'] == "A_CustomField" - test_five['msg'] == "custom_field A_CustomField deleted" + +# Change in NetBox 3.7 +#- name: "CUSTOM_FIELD 6: UI Visibility (hidden-ifunset)" +# netbox.netbox.netbox_custom_field: +# netbox_url: http://localhost:32768 +# netbox_token: 0123456789abcdef0123456789abcdef01234567 +# data: +# content_types: +# - "dcim.device" +# name: A_CustomField +# type: text +# ui_visibility: hidden-ifunset +# state: present +# register: test_six + +#- name: "CUSTOM_FIELD 6: UI Visibility (hidden-ifunset)" +# assert: +# that: +# - test_six is changed +# - test_six['custom_field']['name'] == "A_CustomField" +# - test_six['custom_field']['ui_visibility'] == "hidden-ifunset" diff --git a/tests/integration/targets/v3.4/tasks/netbox_custom_link.yml b/tests/integration/targets/v3.7/tasks/netbox_custom_link.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_custom_link.yml rename to tests/integration/targets/v3.7/tasks/netbox_custom_link.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_device.yml b/tests/integration/targets/v3.7/tasks/netbox_device.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_device.yml rename to tests/integration/targets/v3.7/tasks/netbox_device.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_device_bay.yml b/tests/integration/targets/v3.7/tasks/netbox_device_bay.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_device_bay.yml rename to tests/integration/targets/v3.7/tasks/netbox_device_bay.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_device_bay_template.yml b/tests/integration/targets/v3.7/tasks/netbox_device_bay_template.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_device_bay_template.yml rename to tests/integration/targets/v3.7/tasks/netbox_device_bay_template.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_device_interface.yml b/tests/integration/targets/v3.7/tasks/netbox_device_interface.yml similarity index 98% rename from tests/integration/targets/v3.4/tasks/netbox_device_interface.yml rename to tests/integration/targets/v3.7/tasks/netbox_device_interface.yml index d8e187d65..fa3f10214 100644 --- a/tests/integration/targets/v3.4/tasks/netbox_device_interface.yml +++ b/tests/integration/targets/v3.7/tasks/netbox_device_interface.yml @@ -1,9 +1,6 @@ --- -## -## -### NETBOX_DEVICE_INTERFACE -## -## +# NETBOX_DEVICE_INTERFACE + - name: "1 - Interface with required information" netbox.netbox.netbox_device_interface: netbox_url: "http://localhost:32768" @@ -123,7 +120,7 @@ - test_five['interface']['enabled'] == false - test_five['interface']['type'] == "1000base-t" - test_five['interface']['mgmt_only'] == false - - test_five['interface']['lag'] == 10 + - test_five['interface']['lag'] == test_four["interface"]["id"] - test_five['interface']['mode'] == "access" - test_five['interface']['mtu'] == 1600 @@ -256,6 +253,7 @@ device: Test Nexus One name: Ethernet2/2 description: "Updated child interface from parent device" + type: 1000Base-T (1GE) update_vc_child: True state: present register: test_ten @@ -280,6 +278,7 @@ device: Test Nexus One name: Ethernet2/2 description: "Updated child interface from parent device - test" + type: 1000Base-T (1GE) state: present ignore_errors: yes register: test_eleven diff --git a/tests/integration/targets/v3.4/tasks/netbox_device_interface_template.yml b/tests/integration/targets/v3.7/tasks/netbox_device_interface_template.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_device_interface_template.yml rename to tests/integration/targets/v3.7/tasks/netbox_device_interface_template.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_device_role.yml b/tests/integration/targets/v3.7/tasks/netbox_device_role.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_device_role.yml rename to tests/integration/targets/v3.7/tasks/netbox_device_role.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_device_type.yml b/tests/integration/targets/v3.7/tasks/netbox_device_type.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_device_type.yml rename to tests/integration/targets/v3.7/tasks/netbox_device_type.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_export_template.yml b/tests/integration/targets/v3.7/tasks/netbox_export_template.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_export_template.yml rename to tests/integration/targets/v3.7/tasks/netbox_export_template.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_fhrp_group.yml b/tests/integration/targets/v3.7/tasks/netbox_fhrp_group.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_fhrp_group.yml rename to tests/integration/targets/v3.7/tasks/netbox_fhrp_group.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_fhrp_group_assignment.yml b/tests/integration/targets/v3.7/tasks/netbox_fhrp_group_assignment.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_fhrp_group_assignment.yml rename to tests/integration/targets/v3.7/tasks/netbox_fhrp_group_assignment.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_front_port.yml b/tests/integration/targets/v3.7/tasks/netbox_front_port.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_front_port.yml rename to tests/integration/targets/v3.7/tasks/netbox_front_port.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_front_port_template.yml b/tests/integration/targets/v3.7/tasks/netbox_front_port_template.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_front_port_template.yml rename to tests/integration/targets/v3.7/tasks/netbox_front_port_template.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_inventory_item.yml b/tests/integration/targets/v3.7/tasks/netbox_inventory_item.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_inventory_item.yml rename to tests/integration/targets/v3.7/tasks/netbox_inventory_item.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_inventory_item_role.yml b/tests/integration/targets/v3.7/tasks/netbox_inventory_item_role.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_inventory_item_role.yml rename to tests/integration/targets/v3.7/tasks/netbox_inventory_item_role.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_ip_address.yml b/tests/integration/targets/v3.7/tasks/netbox_ip_address.yml similarity index 86% rename from tests/integration/targets/v3.4/tasks/netbox_ip_address.yml rename to tests/integration/targets/v3.7/tasks/netbox_ip_address.yml index 3cda56d3c..c18cad9bd 100644 --- a/tests/integration/targets/v3.4/tasks/netbox_ip_address.yml +++ b/tests/integration/targets/v3.7/tasks/netbox_ip_address.yml @@ -80,23 +80,24 @@ - test_four['msg'] == "ip_address 192.168.1.20/30 created" - test_four['ip_address']['address'] == "192.168.1.20/30" -- name: "5 - Create IP in global VRF - 192.168.1.20/30 - State: New" - netbox.netbox.netbox_ip_address: - netbox_url: http://localhost:32768 - netbox_token: 0123456789abcdef0123456789abcdef01234567 - data: - address: 192.168.1.20/30 - state: new - register: test_five +# Enforce uniqueness in NetBox 3.7 +#- name: "5 - Create IP in global VRF - 192.168.1.20/30 - State: New" +# netbox.netbox.netbox_ip_address: +# netbox_url: http://localhost:32768 +# netbox_token: 0123456789abcdef0123456789abcdef01234567 +# data: +# address: 192.168.1.20/30 +# state: new +# register: test_five -- name: "5 - ASSERT" - assert: - that: - - test_five is changed - - test_five['diff']['before']['state'] == "absent" - - test_five['diff']['after']['state'] == "present" - - test_five['msg'] == "ip_address 192.168.1.20/30 created" - - test_five['ip_address']['address'] == "192.168.1.20/30" +#- name: "5 - ASSERT" +# assert: +# that: +# - test_five is changed +# - test_five['diff']['before']['state'] == "absent" +# - test_five['diff']['after']['state'] == "present" +# - test_five['msg'] == "ip_address 192.168.1.20/30 created" +# - test_five['ip_address']['address'] == "192.168.1.20/30" - name: "6 - Create new address with only prefix specified - State: new" netbox.netbox.netbox_ip_address: @@ -306,30 +307,31 @@ - test_fourteen['ip_address']['assigned_object_type'] == "virtualization.vminterface" - test_fourteen['ip_address']['assigned_object_id'] == 1 -- name: "15 - Create same IP address on Eth0 - test101-vm - State: present" - netbox.netbox.netbox_ip_address: - netbox_url: http://localhost:32768 - netbox_token: 0123456789abcdef0123456789abcdef01234567 - data: - family: 4 - address: 10.188.1.100/24 - assigned_object: - name: Eth0 - virtual_machine: test101-vm - state: "present" - register: test_fifteen +# Enforce uniqueness in NetBox 3.7 +#- name: "15 - Create same IP address on Eth0 - test101-vm - State: present" +# netbox.netbox.netbox_ip_address: +# netbox_url: http://localhost:32768 +# netbox_token: 0123456789abcdef0123456789abcdef01234567 +# data: +# family: 4 +# address: 10.188.1.100/24 +# assigned_object: +# name: Eth0 +# virtual_machine: test101-vm +# state: "present" +# register: test_fifteen -- name: "15 - ASSERT" - assert: - that: - - test_fifteen is changed - - test_fifteen['diff']['before']['state'] == "absent" - - test_fifteen['diff']['after']['state'] == "present" - - test_fifteen['msg'] == "ip_address 10.188.1.100/24 created" - - test_fifteen['ip_address']['address'] == "10.188.1.100/24" - - test_fifteen['ip_address']['family'] == 4 - - test_fifteen['ip_address']['assigned_object_type'] == "virtualization.vminterface" - - test_fifteen['ip_address']['assigned_object_id'] == 6 +#- name: "15 - ASSERT" +# assert: +# that: +# - test_fifteen is changed +# - test_fifteen['diff']['before']['state'] == "absent" +# - test_fifteen['diff']['after']['state'] == "present" +# - test_fifteen['msg'] == "ip_address 10.188.1.100/24 created" +# - test_fifteen['ip_address']['address'] == "10.188.1.100/24" +# - test_fifteen['ip_address']['family'] == 4 +# - test_fifteen['ip_address']['assigned_object_type'] == "virtualization.vminterface" +# - test_fifteen['ip_address']['assigned_object_id'] == 6 - name: "16 - Create IP address with no mask - State: Present" netbox.netbox.netbox_ip_address: diff --git a/tests/integration/targets/v3.4/tasks/netbox_ipam_role.yml b/tests/integration/targets/v3.7/tasks/netbox_ipam_role.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_ipam_role.yml rename to tests/integration/targets/v3.7/tasks/netbox_ipam_role.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_journal_entry.yml b/tests/integration/targets/v3.7/tasks/netbox_journal_entry.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_journal_entry.yml rename to tests/integration/targets/v3.7/tasks/netbox_journal_entry.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_l2vpn.yml b/tests/integration/targets/v3.7/tasks/netbox_l2vpn.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_l2vpn.yml rename to tests/integration/targets/v3.7/tasks/netbox_l2vpn.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_l2vpn_termination.yml b/tests/integration/targets/v3.7/tasks/netbox_l2vpn_termination.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_l2vpn_termination.yml rename to tests/integration/targets/v3.7/tasks/netbox_l2vpn_termination.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_location.yml b/tests/integration/targets/v3.7/tasks/netbox_location.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_location.yml rename to tests/integration/targets/v3.7/tasks/netbox_location.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_lookup.yml b/tests/integration/targets/v3.7/tasks/netbox_lookup.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_lookup.yml rename to tests/integration/targets/v3.7/tasks/netbox_lookup.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_manufacturer.yml b/tests/integration/targets/v3.7/tasks/netbox_manufacturer.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_manufacturer.yml rename to tests/integration/targets/v3.7/tasks/netbox_manufacturer.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_module_type.yml b/tests/integration/targets/v3.7/tasks/netbox_module_type.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_module_type.yml rename to tests/integration/targets/v3.7/tasks/netbox_module_type.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_platform.yml b/tests/integration/targets/v3.7/tasks/netbox_platform.yml similarity index 88% rename from tests/integration/targets/v3.4/tasks/netbox_platform.yml rename to tests/integration/targets/v3.7/tasks/netbox_platform.yml index 95ccdb4cf..1e3621add 100644 --- a/tests/integration/targets/v3.4/tasks/netbox_platform.yml +++ b/tests/integration/targets/v3.7/tasks/netbox_platform.yml @@ -47,9 +47,6 @@ data: name: Test Platform manufacturer: Test Manufacturer - napalm_driver: ios - napalm_args: - global_delay_factor: 2 state: present register: test_three @@ -58,11 +55,7 @@ that: - test_three is changed - test_three['diff']['after']['manufacturer'] == 3 - - test_three['diff']['after']['napalm_args']['global_delay_factor'] == 2 - - test_three['diff']['after']['napalm_driver'] == "ios" - test_three['platform']['manufacturer'] == 3 - - test_three['platform']['napalm_args']['global_delay_factor'] == 2 - - test_three['platform']['napalm_driver'] == "ios" - test_three['msg'] == "platform Test Platform updated" - name: "PLATFORM 4: ASSERT - Delete" diff --git a/tests/integration/targets/v3.4/tasks/netbox_power_feed.yml b/tests/integration/targets/v3.7/tasks/netbox_power_feed.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_power_feed.yml rename to tests/integration/targets/v3.7/tasks/netbox_power_feed.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_power_outlet.yml b/tests/integration/targets/v3.7/tasks/netbox_power_outlet.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_power_outlet.yml rename to tests/integration/targets/v3.7/tasks/netbox_power_outlet.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_power_outlet_template.yml b/tests/integration/targets/v3.7/tasks/netbox_power_outlet_template.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_power_outlet_template.yml rename to tests/integration/targets/v3.7/tasks/netbox_power_outlet_template.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_power_panel.yml b/tests/integration/targets/v3.7/tasks/netbox_power_panel.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_power_panel.yml rename to tests/integration/targets/v3.7/tasks/netbox_power_panel.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_power_port.yml b/tests/integration/targets/v3.7/tasks/netbox_power_port.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_power_port.yml rename to tests/integration/targets/v3.7/tasks/netbox_power_port.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_power_port_template.yml b/tests/integration/targets/v3.7/tasks/netbox_power_port_template.yml similarity index 54% rename from tests/integration/targets/v3.4/tasks/netbox_power_port_template.yml rename to tests/integration/targets/v3.7/tasks/netbox_power_port_template.yml index 9e7547fd9..aaa5eb43c 100644 --- a/tests/integration/targets/v3.4/tasks/netbox_power_port_template.yml +++ b/tests/integration/targets/v3.7/tasks/netbox_power_port_template.yml @@ -7,7 +7,7 @@ ### NETBOX_POWER_PORT_TEMPLATE ## ## -- name: "POWER_PORT_TEMPLATE 0: Create device type for testing power ports" +- name: "POWER_PORT_TEMPLATE 0.1: Create device type for testing power ports on device types" netbox.netbox.netbox_device_type: netbox_url: http://localhost:32768 netbox_token: 0123456789abcdef0123456789abcdef01234567 @@ -16,6 +16,15 @@ manufacturer: Test Manufacturer state: present +- name: "POWER_PORT_TEMPLATE 0.2: Create module type for testing power ports on module types" + netbox.netbox.netbox_module_type: + netbox_url: http://localhost:32768 + netbox_token: 0123456789abcdef0123456789abcdef01234567 + data: + model: Module Type Power Tests + manufacturer: Test Manufacturer + state: present + - name: "POWER_PORT_TEMPLATE 1: Necessary info creation" netbox.netbox.netbox_power_port_template: netbox_url: http://localhost:32768 @@ -118,3 +127,86 @@ - test_five['diff']['before']['state'] == "present" - test_five['diff']['after']['state'] == "absent" - test_five['msg'] == "power_port_template Power Port Template 2 deleted" + +- name: "POWER_PORT_TEMPLATE 6: Necessary info creation" + netbox.netbox.netbox_power_port_template: + netbox_url: http://localhost:32768 + netbox_token: 0123456789abcdef0123456789abcdef01234567 + data: + name: Module Power Port Template + module_type: Module Type Power Tests + state: present + register: test_six + +- name: "POWER_PORT_TEMPLATE 6: ASSERT - Necessary info creation" + assert: + that: + - test_six is changed + - test_six['diff']['before']['state'] == "absent" + - test_six['diff']['after']['state'] == "present" + - test_six['power_port_template']['name'] == "Module Power Port Template" + - test_six['power_port_template']['module_type'] == 1 + - test_six['msg'] == "power_port_template Module Power Port Template created" + +- name: "POWER_PORT_TEMPLATE 7: Create duplicate" + netbox.netbox.netbox_power_port_template: + netbox_url: http://localhost:32768 + netbox_token: 0123456789abcdef0123456789abcdef01234567 + data: + name: Module Power Port Template + module_type: Module Type Power Tests + state: present + register: test_seven + +- name: "POWER_PORT_TEMPLATE 7: ASSERT - Create duplicate" + assert: + that: + - not test_seven['changed'] + - test_seven['power_port_template']['name'] == "Module Power Port Template" + - test_seven['power_port_template']['module_type'] == 1 + - test_seven['msg'] == "power_port_template Module Power Port Template already exists" + +- name: "POWER_PORT_TEMPLATE 8: Update power_port_template with other fields" + netbox.netbox.netbox_power_port_template: + netbox_url: http://localhost:32768 + netbox_token: 0123456789abcdef0123456789abcdef01234567 + data: + name: Module Power Port Template + module_type: Module Type Power Tests + type: ita-e + allocated_draw: 10 + maximum_draw: 20 + state: present + register: test_eight + +- name: "POWER_PORT_TEMPLATE 8: ASSERT - Update power_port_template with other fields" + assert: + that: + - test_eight is changed + - test_eight['diff']['after']['type'] == "ita-e" + - test_eight['diff']['after']['allocated_draw'] == 10 + - test_eight['diff']['after']['maximum_draw'] == 20 + - test_eight['power_port_template']['name'] == "Module Power Port Template" + - test_eight['power_port_template']['module_type'] == 1 + - test_eight['power_port_template']['type'] == "ita-e" + - test_eight['power_port_template']['allocated_draw'] == 10 + - test_eight['power_port_template']['maximum_draw'] == 20 + - test_eight['msg'] == "power_port_template Module Power Port Template updated" + +- name: "POWER_PORT_TEMPLATE 9: Delete Power Port Template" + netbox.netbox.netbox_power_port_template: + netbox_url: http://localhost:32768 + netbox_token: 0123456789abcdef0123456789abcdef01234567 + data: + name: Module Power Port Template + module_type: Module Type Power Tests + state: absent + register: test_nine + +- name: "POWER_PORT_TEMPLATE 9: ASSERT - Delete Power Port Template" + assert: + that: + - test_nine is changed + - test_nine['diff']['before']['state'] == "present" + - test_nine['diff']['after']['state'] == "absent" + - test_nine['msg'] == "power_port_template Module Power Port Template deleted" diff --git a/tests/integration/targets/v3.4/tasks/netbox_prefix.yml b/tests/integration/targets/v3.7/tasks/netbox_prefix.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_prefix.yml rename to tests/integration/targets/v3.7/tasks/netbox_prefix.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_provider.yml b/tests/integration/targets/v3.7/tasks/netbox_provider.yml similarity index 92% rename from tests/integration/targets/v3.4/tasks/netbox_provider.yml rename to tests/integration/targets/v3.7/tasks/netbox_provider.yml index 246788991..cba224eb4 100644 --- a/tests/integration/targets/v3.4/tasks/netbox_provider.yml +++ b/tests/integration/targets/v3.7/tasks/netbox_provider.yml @@ -46,7 +46,6 @@ netbox_token: 0123456789abcdef0123456789abcdef01234567 data: name: Test Provider One - account: "200129104" comments: "BAD PROVIDER" state: present register: test_three @@ -55,11 +54,9 @@ assert: that: - test_three is changed - - test_three['diff']['after']['account'] == "200129104" - test_three['diff']['after']['comments'] == "BAD PROVIDER" - test_three['provider']['name'] == "Test Provider One" - test_three['provider']['slug'] == "test-provider-one" - - test_three['provider']['account'] == "200129104" - test_three['provider']['comments'] == "BAD PROVIDER" - test_three['msg'] == "provider Test Provider One updated" @@ -78,6 +75,5 @@ - test_four is changed - test_four['provider']['name'] == "Test Provider One" - test_four['provider']['slug'] == "test-provider-one" - - test_four['provider']['account'] == "200129104" - test_four['provider']['comments'] == "BAD PROVIDER" - test_four['msg'] == "provider Test Provider One deleted" diff --git a/tests/integration/targets/v3.4/tasks/netbox_provider_network.yml b/tests/integration/targets/v3.7/tasks/netbox_provider_network.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_provider_network.yml rename to tests/integration/targets/v3.7/tasks/netbox_provider_network.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_rack.yml b/tests/integration/targets/v3.7/tasks/netbox_rack.yml similarity index 99% rename from tests/integration/targets/v3.4/tasks/netbox_rack.yml rename to tests/integration/targets/v3.7/tasks/netbox_rack.yml index 8b96c56c1..245dd0c29 100644 --- a/tests/integration/targets/v3.4/tasks/netbox_rack.yml +++ b/tests/integration/targets/v3.7/tasks/netbox_rack.yml @@ -206,7 +206,7 @@ assert: that: - test_seven is failed - - "'Asset tag already exists' in test_seven['msg']" + - "'asset tag already exists' in test_seven['msg']" - name: "8 - Test delete" netbox.netbox.netbox_rack: diff --git a/tests/integration/targets/v3.4/tasks/netbox_rack_group.yml b/tests/integration/targets/v3.7/tasks/netbox_rack_group.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_rack_group.yml rename to tests/integration/targets/v3.7/tasks/netbox_rack_group.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_rack_role.yml b/tests/integration/targets/v3.7/tasks/netbox_rack_role.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_rack_role.yml rename to tests/integration/targets/v3.7/tasks/netbox_rack_role.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_rear_port.yml b/tests/integration/targets/v3.7/tasks/netbox_rear_port.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_rear_port.yml rename to tests/integration/targets/v3.7/tasks/netbox_rear_port.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_rear_port_template.yml b/tests/integration/targets/v3.7/tasks/netbox_rear_port_template.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_rear_port_template.yml rename to tests/integration/targets/v3.7/tasks/netbox_rear_port_template.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_region.yml b/tests/integration/targets/v3.7/tasks/netbox_region.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_region.yml rename to tests/integration/targets/v3.7/tasks/netbox_region.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_rir.yml b/tests/integration/targets/v3.7/tasks/netbox_rir.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_rir.yml rename to tests/integration/targets/v3.7/tasks/netbox_rir.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_route_target.yml b/tests/integration/targets/v3.7/tasks/netbox_route_target.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_route_target.yml rename to tests/integration/targets/v3.7/tasks/netbox_route_target.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_service.yml b/tests/integration/targets/v3.7/tasks/netbox_service.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_service.yml rename to tests/integration/targets/v3.7/tasks/netbox_service.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_service_template.yml b/tests/integration/targets/v3.7/tasks/netbox_service_template.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_service_template.yml rename to tests/integration/targets/v3.7/tasks/netbox_service_template.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_site.yml b/tests/integration/targets/v3.7/tasks/netbox_site.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_site.yml rename to tests/integration/targets/v3.7/tasks/netbox_site.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_site_group.yml b/tests/integration/targets/v3.7/tasks/netbox_site_group.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_site_group.yml rename to tests/integration/targets/v3.7/tasks/netbox_site_group.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_tag.yml b/tests/integration/targets/v3.7/tasks/netbox_tag.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_tag.yml rename to tests/integration/targets/v3.7/tasks/netbox_tag.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_tenant.yml b/tests/integration/targets/v3.7/tasks/netbox_tenant.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_tenant.yml rename to tests/integration/targets/v3.7/tasks/netbox_tenant.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_tenant_group.yml b/tests/integration/targets/v3.7/tasks/netbox_tenant_group.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_tenant_group.yml rename to tests/integration/targets/v3.7/tasks/netbox_tenant_group.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_virtual_chassis.yml b/tests/integration/targets/v3.7/tasks/netbox_virtual_chassis.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_virtual_chassis.yml rename to tests/integration/targets/v3.7/tasks/netbox_virtual_chassis.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_virtual_machine.yml b/tests/integration/targets/v3.7/tasks/netbox_virtual_machine.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_virtual_machine.yml rename to tests/integration/targets/v3.7/tasks/netbox_virtual_machine.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_vlan.yml b/tests/integration/targets/v3.7/tasks/netbox_vlan.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_vlan.yml rename to tests/integration/targets/v3.7/tasks/netbox_vlan.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_vlan_group.yml b/tests/integration/targets/v3.7/tasks/netbox_vlan_group.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_vlan_group.yml rename to tests/integration/targets/v3.7/tasks/netbox_vlan_group.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_vm_interface.yml b/tests/integration/targets/v3.7/tasks/netbox_vm_interface.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_vm_interface.yml rename to tests/integration/targets/v3.7/tasks/netbox_vm_interface.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_vrf.yml b/tests/integration/targets/v3.7/tasks/netbox_vrf.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_vrf.yml rename to tests/integration/targets/v3.7/tasks/netbox_vrf.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_webhook.yml b/tests/integration/targets/v3.7/tasks/netbox_webhook.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_webhook.yml rename to tests/integration/targets/v3.7/tasks/netbox_webhook.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_wireless_lan.yml b/tests/integration/targets/v3.7/tasks/netbox_wireless_lan.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_wireless_lan.yml rename to tests/integration/targets/v3.7/tasks/netbox_wireless_lan.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_wireless_lan_group.yml b/tests/integration/targets/v3.7/tasks/netbox_wireless_lan_group.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_wireless_lan_group.yml rename to tests/integration/targets/v3.7/tasks/netbox_wireless_lan_group.yml diff --git a/tests/integration/targets/v3.4/tasks/netbox_wireless_link.yml b/tests/integration/targets/v3.7/tasks/netbox_wireless_link.yml similarity index 100% rename from tests/integration/targets/v3.4/tasks/netbox_wireless_link.yml rename to tests/integration/targets/v3.7/tasks/netbox_wireless_link.yml diff --git a/tests/netbox-docker/v3.2/docker-compose.override.yml b/tests/netbox-docker/v3.2/docker-compose.override.yml deleted file mode 100644 index 3a16676e7..000000000 --- a/tests/netbox-docker/v3.2/docker-compose.override.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -version: '3.4' -services: - netbox-worker: &netbox-override - image: netboxcommunity/netbox:v3.2 - netbox: - <<: *netbox-override - ports: - - 32768:8080 - environment: - SKIP_SUPERUSER: "false" - SUPERUSER_API_TOKEN: "0123456789abcdef0123456789abcdef01234567" - SUPERUSER_EMAIL: "admin@localhost.com" - SUPERUSER_NAME: "admin" - SUPERUSER_PASSWORD: "admin" diff --git a/tests/netbox-docker/v3.3/docker-compose.override.yml b/tests/netbox-docker/v3.3/docker-compose.override.yml deleted file mode 100644 index 5f86ccac8..000000000 --- a/tests/netbox-docker/v3.3/docker-compose.override.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -version: '3.4' -services: - netbox-worker: &netbox-override - image: netboxcommunity/netbox:v3.3 - netbox: - <<: *netbox-override - ports: - - 32768:8080 - environment: - SKIP_SUPERUSER: "false" - SUPERUSER_API_TOKEN: "0123456789abcdef0123456789abcdef01234567" - SUPERUSER_EMAIL: "admin@localhost.com" - SUPERUSER_NAME: "admin" - SUPERUSER_PASSWORD: "admin" diff --git a/tests/netbox-docker/v3.4/docker-compose.override.yml b/tests/netbox-docker/v3.7/docker-compose.override.yml similarity index 72% rename from tests/netbox-docker/v3.4/docker-compose.override.yml rename to tests/netbox-docker/v3.7/docker-compose.override.yml index 04d96d271..47e7e80c0 100644 --- a/tests/netbox-docker/v3.4/docker-compose.override.yml +++ b/tests/netbox-docker/v3.7/docker-compose.override.yml @@ -2,7 +2,12 @@ version: '3.4' services: netbox-worker: &netbox-override - image: netboxcommunity/netbox:v3.4 + image: netboxcommunity/netbox:v3.7 + healthcheck: + start_period: 300s + timeout: 3s + interval: 15s + test: "ps -aux | grep -v grep | grep -q rqworker || exit 1" netbox: <<: *netbox-override ports: