-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into ndfc_custom_network
- Loading branch information
Showing
200 changed files
with
37,494 additions
and
2,405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"python.testing.pytestArgs": ["tests"], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,45 @@ | ||
--- | ||
# This playbook can be used to execute the dcnm_fabric test role. | ||
# | ||
# Replace the vars: section with details for your 2 spine, 4 leaf fabric. | ||
# This playbook can be used to execute integration tests for | ||
# the role located in: | ||
# | ||
# Modify the vars section with details for testing setup. | ||
# | ||
# NOTES: | ||
# 1. For the IPFM test cases (dcnm_*_ipfm), ensure that the controller | ||
# is running in IPFM mode. i.e. Ensure that | ||
# Fabric Controller -> Admin -> System Settings -> Feature Management | ||
# "IP Fabric for Media" is checked. | ||
# 2. For all other test cases, ensure that | ||
# Fabric Controller -> Admin -> System Settings -> Feature Management | ||
# "Fabric Builder" is checked. | ||
- hosts: dcnm | ||
gather_facts: no | ||
connection: ansible.netcommon.httpapi | ||
|
||
vars: | ||
# This testcase field can run any test in the tests directory for the role | ||
testcase: spine_leaf_basic | ||
fabric_name: fabric-name | ||
spine1: n9k-spine1.example.com | ||
spine2: n9k-spine2.example.com | ||
leaf1: n9k-leaf1.example.com | ||
leaf2: n9k-leaf2.example.com | ||
leaf3: n9k-leaf3.example.com | ||
leaf4: n9k-leaf4.example.com | ||
username: admin | ||
password: "secret-password" | ||
# testcase: dcnm_fabric_deleted_basic | ||
# testcase: dcnm_fabric_deleted_basic_ipfm | ||
# testcase: dcnm_fabric_merged_basic | ||
# testcase: dcnm_fabric_merged_basic_ipfm | ||
# testcase: dcnm_fabric_merged_save_deploy | ||
# testcase: dcnm_fabric_merged_save_deploy_ipfm | ||
# testcase: dcnm_fabric_replaced_basic | ||
# testcase: dcnm_fabric_replaced_basic_ipfm | ||
# testcase: dcnm_fabric_replaced_save_deploy | ||
# testcase: dcnm_fabric_replaced_save_deploy_ipfm | ||
fabric_name_1: VXLAN_EVPN_Fabric | ||
fabric_type_1: VXLAN_EVPN | ||
fabric_name_2: VXLAN_EVPN_MSD_Fabric | ||
fabric_type_2: VXLAN_EVPN_MSD | ||
fabric_name_3: LAN_CLASSIC_Fabric | ||
fabric_type_3: LAN_CLASSIC | ||
fabric_name_4: IPFM_Fabric | ||
fabric_type_4: IPFM | ||
leaf_1: 172.22.150.103 | ||
leaf_2: 172.22.150.104 | ||
nxos_username: admin | ||
nxos_password: myNxosPassword | ||
|
||
roles: | ||
- dcnm_fabric | ||
|
||
# Uncomment the following play if you want to verify connectivity between | ||
# host a and host c and d across the vxlan fabric setup by test spine_leaf_basic | ||
# | ||
|
||
# - hosts: nxos | ||
# gather_facts: no | ||
# connection: ansible.netcommon.network_cli | ||
# | ||
# tasks: | ||
# - name: Verify IP reachability for vni 4000 | ||
# nxos_ping: | ||
# dest: 192.168.1.20 | ||
# state: present | ||
# | ||
# - name: Verify IP reachability for vni 7000 | ||
# nxos_ping: | ||
# dest: 192.168.2.20 | ||
# state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
all: | ||
vars: | ||
ansible_user: "admin" | ||
ansible_password: "password-secret" | ||
ansible_python_interpreter: python | ||
ansible_httpapi_validate_certs: False | ||
ansible_httpapi_use_ssl: True | ||
children: | ||
dcnm: | ||
vars: | ||
ansible_connection: ansible.netcommon.httpapi | ||
ansible_network_os: cisco.dcnm.dcnm | ||
hosts: | ||
dcnm-instance.example.com: | ||
nxos: | ||
hosts: | ||
n9k-hosta.example.com: | ||
ansible_connection: ansible.netcommon.network_cli | ||
ansible_network_os: cisco.nxos.nxos | ||
ansible_ssh_port: 22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
# This playbook can be used to execute integration tests for | ||
# the role located in: | ||
# | ||
# tests/integration/targets/dcnm_maintenance_mode | ||
# | ||
# Modify the vars section with details for your testing setup. | ||
# | ||
# NOTES: | ||
# 1. For the IPFM test cases (dcnm_*_ipfm), ensure that the controller | ||
# is running in IPFM mode. i.e. Ensure that | ||
# Fabric Controller -> Admin -> System Settings -> Feature Management | ||
# "IP Fabric for Media" is checked. | ||
# 2. For all other test cases, ensure that | ||
# Fabric Controller -> Admin -> System Settings -> Feature Management | ||
# "Fabric Builder" is checked. | ||
- hosts: dcnm | ||
gather_facts: no | ||
connection: ansible.netcommon.httpapi | ||
|
||
vars: | ||
# See the following location for available test cases: | ||
# tests/integration/targets/dcnm_maintenance_mode/tests | ||
# testcase: 00_setup_fabrics_1x_rw | ||
# testcase: 00_setup_fabrics_2x_rw | ||
# testcase: 01_merged_maintenance_mode_deploy | ||
# testcase: 01_merged_maintenance_mode_no_deploy | ||
fabric_name_1: VXLAN_EVPN_Fabric | ||
fabric_type_1: VXLAN_EVPN | ||
fabric_name_2: VXLAN_EVPN_MSD_Fabric | ||
fabric_type_2: VXLAN_EVPN_MSD | ||
fabric_name_3: LAN_CLASSIC_Fabric | ||
fabric_type_3: LAN_CLASSIC | ||
fabric_name_4: IPFM_Fabric | ||
fabric_type_4: IPFM | ||
leaf_1: 172.22.150.103 | ||
leaf_2: 172.22.150.104 | ||
nxos_username: admin | ||
nxos_password: myNxosPassword | ||
|
||
roles: | ||
- dcnm_maintenance_mode |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Copyright (c) 2024 Cisco and/or its affiliates. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from __future__ import absolute_import, division, print_function | ||
|
||
__metaclass__ = type | ||
__author__ = "Allen Robel" | ||
|
||
import logging | ||
|
||
from ansible_collections.cisco.dcnm.plugins.module_utils.common.conversion import \ | ||
ConversionUtils | ||
|
||
|
||
class Api: | ||
""" | ||
## API endpoints - Api() | ||
### Description | ||
Common methods and properties for Api() subclasses. | ||
### Path | ||
``/appcenter/cisco/ndfc/api`` | ||
""" | ||
|
||
def __init__(self): | ||
self.class_name = self.__class__.__name__ | ||
self.log = logging.getLogger(f"dcnm.{self.class_name}") | ||
self.conversion = ConversionUtils() | ||
# Popuate in subclasses to indicate which properties | ||
# are mandatory for the subclass. | ||
self.required_properties = set() | ||
self.log.debug("ENTERED api.Api()") | ||
self.api = "/appcenter/cisco/ndfc/api" | ||
self._init_properties() | ||
|
||
def _init_properties(self): | ||
self.properties = {} | ||
self.properties["path"] = None | ||
self.properties["verb"] = None | ||
|
||
@property | ||
def path(self): | ||
""" | ||
Return the endpoint path. | ||
""" | ||
return self.properties["path"] | ||
|
||
@property | ||
def verb(self): | ||
""" | ||
Return the endpoint verb. | ||
""" | ||
return self.properties["verb"] |
Empty file.
Empty file.
42 changes: 42 additions & 0 deletions
42
plugins/module_utils/common/api/v1/configtemplate/configtemplate.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright (c) 2024 Cisco and/or its affiliates. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from __future__ import absolute_import, division, print_function | ||
|
||
__metaclass__ = type | ||
__author__ = "Allen Robel" | ||
|
||
import logging | ||
|
||
from ansible_collections.cisco.dcnm.plugins.module_utils.common.api.v1.v1 import \ | ||
V1 | ||
|
||
|
||
class ConfigTemplate(V1): | ||
""" | ||
## V1 API - ConfigTemplate() | ||
### Description | ||
Common methods and properties for api.v1.ConfigTemplate() subclasses | ||
### Path | ||
``/appcenter/cisco/ndfc/api/v1/configtemplate`` | ||
""" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self.class_name = self.__class__.__name__ | ||
self.log = logging.getLogger(f"dcnm.{self.class_name}") | ||
self.configtemplate = f"{self.v1}/configtemplate" | ||
self.log.debug("ENTERED api.v1.configtemplate.ConfigTemplate()") |
Empty file.
Empty file.
49 changes: 49 additions & 0 deletions
49
plugins/module_utils/common/api/v1/configtemplate/rest/config/config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright (c) 2024 Cisco and/or its affiliates. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# pylint: disable=line-too-long | ||
from __future__ import absolute_import, division, print_function | ||
|
||
__metaclass__ = type | ||
__author__ = "Allen Robel" | ||
|
||
import logging | ||
|
||
from ansible_collections.cisco.dcnm.plugins.module_utils.common.api.v1.configtemplate.rest.rest import \ | ||
Rest | ||
|
||
|
||
class Config(Rest): | ||
""" | ||
## V1 API Config() - api.v1.configtemplate.rest.config.Config() | ||
### Description | ||
Common methods and properties for api.v1.configtemplate.rest.config.Config() subclasses. | ||
### Path | ||
- ``/api/v1/configtemplate/rest/config`` | ||
""" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self.class_name = self.__class__.__name__ | ||
self.log = logging.getLogger(f"dcnm.{self.class_name}") | ||
self.config = f"{self.rest}/config" | ||
msg = f"ENTERED api.v1.rest.config.{self.class_name}" | ||
self.log.debug(msg) | ||
self._build_properties() | ||
|
||
def _build_properties(self): | ||
""" | ||
- Populate class-specific properties. | ||
""" |
Empty file.
Oops, something went wrong.