From 00bc9f7a3c8db71e4dc587626a53c3dabbae6a3f Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 05:57:16 -0400 Subject: [PATCH 01/20] initial test updates to remove ignores and replace with module placeholders --- plugins/modules/common/check_roles.py | 62 ++++++++++++++++++ plugins/modules/common/get_credentials.py | 62 ++++++++++++++++++ plugins/modules/common/nac_dc_validate.py | 62 ++++++++++++++++++ .../prepare_plugins/prep_001_list_defaults.py | 63 ++++++++++++++++++ .../common/prepare_plugins/prep_101_global.py | 63 ++++++++++++++++++ .../prep_103_topology_switches.py | 63 ++++++++++++++++++ .../prep_104_fabric_overlay_services.py | 64 +++++++++++++++++++ .../prep_105_topology_interfaces.py | 64 +++++++++++++++++++ .../prep_106_topology_vpc_interfaces.py | 64 +++++++++++++++++++ .../common/prepare_plugins/prep_107_policy.py | 64 +++++++++++++++++++ .../modules/common/prepare_service_model.py | 63 ++++++++++++++++++ plugins/modules/common/read_run_map.py | 62 ++++++++++++++++++ plugins/modules/common/run_map.py | 62 ++++++++++++++++++ plugins/modules/dtc/add_device_check.py | 62 ++++++++++++++++++ plugins/modules/dtc/diff_model_changes.py | 62 ++++++++++++++++++ .../dtc/update_switch_hostname_policy.py | 62 ++++++++++++++++++ plugins/modules/dtc/verify_tags.py | 62 ++++++++++++++++++ plugins/modules/dtc/vpc_pair_check.py | 62 ++++++++++++++++++ plugins/modules/dtd/prepare_service_model.py | 62 ++++++++++++++++++ plugins/modules/test/inventory.py | 62 ++++++++++++++++++ tests/sanity/ignore-2.14.txt | 9 --- tests/sanity/ignore-2.15.txt | 9 --- tests/sanity/ignore-2.16.txt | 9 --- 23 files changed, 1252 insertions(+), 27 deletions(-) create mode 100644 plugins/modules/common/check_roles.py create mode 100644 plugins/modules/common/get_credentials.py create mode 100644 plugins/modules/common/nac_dc_validate.py create mode 100644 plugins/modules/common/prepare_plugins/prep_001_list_defaults.py create mode 100644 plugins/modules/common/prepare_plugins/prep_101_global.py create mode 100644 plugins/modules/common/prepare_plugins/prep_103_topology_switches.py create mode 100644 plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py create mode 100644 plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py create mode 100644 plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py create mode 100644 plugins/modules/common/prepare_plugins/prep_107_policy.py create mode 100644 plugins/modules/common/prepare_service_model.py create mode 100644 plugins/modules/common/read_run_map.py create mode 100644 plugins/modules/common/run_map.py create mode 100644 plugins/modules/dtc/add_device_check.py create mode 100644 plugins/modules/dtc/diff_model_changes.py create mode 100644 plugins/modules/dtc/update_switch_hostname_policy.py create mode 100644 plugins/modules/dtc/verify_tags.py create mode 100644 plugins/modules/dtc/vpc_pair_check.py create mode 100644 plugins/modules/dtd/prepare_service_model.py create mode 100644 plugins/modules/test/inventory.py diff --git a/plugins/modules/common/check_roles.py b/plugins/modules/common/check_roles.py new file mode 100644 index 000000000..be95d9111 --- /dev/null +++ b/plugins/modules/common/check_roles.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_001_list_defaults +short_description: Prepare action plugin to default any emptry or nested list in the data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to default any emptry or nested list in the data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/common/get_credentials.py b/plugins/modules/common/get_credentials.py new file mode 100644 index 000000000..be95d9111 --- /dev/null +++ b/plugins/modules/common/get_credentials.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_001_list_defaults +short_description: Prepare action plugin to default any emptry or nested list in the data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to default any emptry or nested list in the data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/common/nac_dc_validate.py b/plugins/modules/common/nac_dc_validate.py new file mode 100644 index 000000000..706041107 --- /dev/null +++ b/plugins/modules/common/nac_dc_validate.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: nac_dc_validate +short_description: Prepare action plugin to validate the data model against the schema and return the rendered data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to validate the data model against the schema and return the rendered data model. +options: + schema: + description: + - The path to the schema file. + required: false + type: str + mdata: + description: + - The path to the model data dir. + required: true + type: dict + rules: + description: + - The path to the rules dir. + required: false + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.nac_dc_validate: + schema: "{{ schema_path }}" + mdata: "{{ data_path }}" + rules: "{{ rules_path }}" + register: model_data + +""" \ No newline at end of file diff --git a/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py b/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py new file mode 100644 index 000000000..8ab8ca977 --- /dev/null +++ b/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py @@ -0,0 +1,63 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_001_list_defaults +short_description: Prepare action plugin for list and nested list elementes of the extended data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Invoked from the main prepare action plugin prepare_service_model. +- Prepare action plugin for list and nested list elementes of the extended data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Prepare Data Model and Return Extended Data Model + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/common/prepare_plugins/prep_101_global.py b/plugins/modules/common/prepare_plugins/prep_101_global.py new file mode 100644 index 000000000..99e6296ca --- /dev/null +++ b/plugins/modules/common/prepare_plugins/prep_101_global.py @@ -0,0 +1,63 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_101_global +short_description: Prepare action plugin for global elementes of the extended data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Invoked from the main prepare action plugin prepare_service_model. +- Prepare action plugin for global elementes of the extended data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Prepare Data Model and Return Extended Data Model + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py b/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py new file mode 100644 index 000000000..ce86cd535 --- /dev/null +++ b/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py @@ -0,0 +1,63 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_103_topology_switches +short_description: Prepare action plugin for topology elementes of the extended data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Invoked from the main prepare action plugin prepare_service_model. +- Prepare action plugin for topology elementes of the extended data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Prepare Data Model and Return Extended Data Model + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py b/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py new file mode 100644 index 000000000..e1520412e --- /dev/null +++ b/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py @@ -0,0 +1,64 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_104_fabric_overlay_services +short_description: Prepare action plugin for overlay vrf & network elementes of the extended data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Invoked from the main prepare action plugin prepare_service_model. +- Prepare action plugin for overlay vrf & network elementes of the extended data model. +- Maps the overlay vrf & network elements switch attach group entries from hostname to mgmt IP address. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Prepare Data Model and Return Extended Data Model + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py b/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py new file mode 100644 index 000000000..5dc09271f --- /dev/null +++ b/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py @@ -0,0 +1,64 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_105_topology_interfaces +short_description: Prepare action plugin for interface elementes of the extended data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Invoked from the main prepare action plugin prepare_service_model. +- Prepare action plugin for interface elementes of the extended data model. +- Prepares count of specific interface modes/types. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Prepare Data Model and Return Extended Data Model + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py b/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py new file mode 100644 index 000000000..9cfd5c273 --- /dev/null +++ b/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py @@ -0,0 +1,64 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_106_topology_vpc_interfaces +short_description: Prepare action plugin for Cisco vPC interface elementes of the extended data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Invoked from the main prepare action plugin prepare_service_model. +- Prepare action plugin for Cisco vPC interface elementes of the extended data model. +- Prepares mapping between Cisco vPC peer1 and peer2 for interfaces. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Prepare Data Model and Return Extended Data Model + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/common/prepare_plugins/prep_107_policy.py b/plugins/modules/common/prepare_plugins/prep_107_policy.py new file mode 100644 index 000000000..eb21449b7 --- /dev/null +++ b/plugins/modules/common/prepare_plugins/prep_107_policy.py @@ -0,0 +1,64 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_107_policy +short_description: Prepare action plugin for policy elementes of the extended data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Invoked from the main prepare action plugin prepare_service_model. +- Prepare action plugin for policy elementes of the extended data model. +- Prepares hostname to IP address mapping for swtich group policy. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Prepare Data Model and Return Extended Data Model + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/common/prepare_service_model.py b/plugins/modules/common/prepare_service_model.py new file mode 100644 index 000000000..c6c288259 --- /dev/null +++ b/plugins/modules/common/prepare_service_model.py @@ -0,0 +1,63 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prepare_service_model +short_description: Prepare action plugin to prepare extended runtime data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to prepare extended runtime data model. +- Additional prepare action plugins are invoked for different parts of the data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# # Prepare Data Model and Return Extended Data Model + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/common/read_run_map.py b/plugins/modules/common/read_run_map.py new file mode 100644 index 000000000..be95d9111 --- /dev/null +++ b/plugins/modules/common/read_run_map.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_001_list_defaults +short_description: Prepare action plugin to default any emptry or nested list in the data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to default any emptry or nested list in the data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/common/run_map.py b/plugins/modules/common/run_map.py new file mode 100644 index 000000000..be95d9111 --- /dev/null +++ b/plugins/modules/common/run_map.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_001_list_defaults +short_description: Prepare action plugin to default any emptry or nested list in the data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to default any emptry or nested list in the data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/dtc/add_device_check.py b/plugins/modules/dtc/add_device_check.py new file mode 100644 index 000000000..be95d9111 --- /dev/null +++ b/plugins/modules/dtc/add_device_check.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_001_list_defaults +short_description: Prepare action plugin to default any emptry or nested list in the data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to default any emptry or nested list in the data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/dtc/diff_model_changes.py b/plugins/modules/dtc/diff_model_changes.py new file mode 100644 index 000000000..be95d9111 --- /dev/null +++ b/plugins/modules/dtc/diff_model_changes.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_001_list_defaults +short_description: Prepare action plugin to default any emptry or nested list in the data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to default any emptry or nested list in the data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/dtc/update_switch_hostname_policy.py b/plugins/modules/dtc/update_switch_hostname_policy.py new file mode 100644 index 000000000..be95d9111 --- /dev/null +++ b/plugins/modules/dtc/update_switch_hostname_policy.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_001_list_defaults +short_description: Prepare action plugin to default any emptry or nested list in the data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to default any emptry or nested list in the data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/dtc/verify_tags.py b/plugins/modules/dtc/verify_tags.py new file mode 100644 index 000000000..be95d9111 --- /dev/null +++ b/plugins/modules/dtc/verify_tags.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_001_list_defaults +short_description: Prepare action plugin to default any emptry or nested list in the data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to default any emptry or nested list in the data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/dtc/vpc_pair_check.py b/plugins/modules/dtc/vpc_pair_check.py new file mode 100644 index 000000000..be95d9111 --- /dev/null +++ b/plugins/modules/dtc/vpc_pair_check.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_001_list_defaults +short_description: Prepare action plugin to default any emptry or nested list in the data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to default any emptry or nested list in the data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/dtd/prepare_service_model.py b/plugins/modules/dtd/prepare_service_model.py new file mode 100644 index 000000000..be95d9111 --- /dev/null +++ b/plugins/modules/dtd/prepare_service_model.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_001_list_defaults +short_description: Prepare action plugin to default any emptry or nested list in the data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to default any emptry or nested list in the data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/plugins/modules/test/inventory.py b/plugins/modules/test/inventory.py new file mode 100644 index 000000000..be95d9111 --- /dev/null +++ b/plugins/modules/test/inventory.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function + + +DOCUMENTATION = """ +--- +module: prep_001_list_defaults +short_description: Prepare action plugin to default any emptry or nested list in the data model. +version_added: "0.1.0" +author: Cisco Systems +description: +- Prepare action plugin to default any emptry or nested list in the data model. +options: + inventory_hostname: + description: + - Ansible inventory_hostname. + required: true + type: str + hostvars: + description: + - Ansible runtime hostvars data. + required: true + type: dict + model_data: + description: + - The path to the data dir. + required: true + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.prepare_service_model: + inventory_hostname: "{{ inventory_hostname }}" + hostvars: "{{ hostvars }}" + model_data: "{{ model_data['data'] }}" + register: smd + +""" \ No newline at end of file diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 992dca8cb..2dfddfb6d 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1,13 +1,4 @@ plugins/action/common/check_roles.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/nac_dc_validate.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_001_list_defaults.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_101_global.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_103_topology_switches.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_104_fabric_overlay_services.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_105_topology_interfaces.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_106_topology_vpc_interfaces.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_107_policy.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_service_model.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/get_credentials.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/run_map.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/read_run_map.py action-plugin-docs # action plugin has no matching module to provide documentation diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 992dca8cb..2dfddfb6d 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -1,13 +1,4 @@ plugins/action/common/check_roles.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/nac_dc_validate.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_001_list_defaults.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_101_global.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_103_topology_switches.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_104_fabric_overlay_services.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_105_topology_interfaces.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_106_topology_vpc_interfaces.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_107_policy.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_service_model.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/get_credentials.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/run_map.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/read_run_map.py action-plugin-docs # action plugin has no matching module to provide documentation diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 992dca8cb..2dfddfb6d 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -1,13 +1,4 @@ plugins/action/common/check_roles.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/nac_dc_validate.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_001_list_defaults.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_101_global.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_103_topology_switches.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_104_fabric_overlay_services.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_105_topology_interfaces.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_106_topology_vpc_interfaces.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_plugins/prep_107_policy.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/prepare_service_model.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/get_credentials.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/run_map.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/read_run_map.py action-plugin-docs # action plugin has no matching module to provide documentation From 0e121790822542f85428d9c37c65ef86f57e70e9 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 06:10:40 -0400 Subject: [PATCH 02/20] update author based on error to retest --- plugins/modules/common/check_roles.py | 62 ------------------- plugins/modules/common/get_credentials.py | 62 ------------------- plugins/modules/common/nac_dc_validate.py | 2 +- .../prepare_plugins/prep_001_list_defaults.py | 2 +- .../common/prepare_plugins/prep_101_global.py | 2 +- .../prep_103_topology_switches.py | 2 +- .../prep_104_fabric_overlay_services.py | 2 +- .../prep_105_topology_interfaces.py | 2 +- .../prep_106_topology_vpc_interfaces.py | 2 +- .../common/prepare_plugins/prep_107_policy.py | 2 +- .../modules/common/prepare_service_model.py | 2 +- plugins/modules/common/read_run_map.py | 62 ------------------- plugins/modules/common/run_map.py | 62 ------------------- plugins/modules/dtc/add_device_check.py | 62 ------------------- plugins/modules/dtc/diff_model_changes.py | 62 ------------------- .../dtc/update_switch_hostname_policy.py | 62 ------------------- plugins/modules/dtc/verify_tags.py | 62 ------------------- plugins/modules/dtc/vpc_pair_check.py | 62 ------------------- plugins/modules/dtd/prepare_service_model.py | 62 ------------------- plugins/modules/test/inventory.py | 62 ------------------- 20 files changed, 9 insertions(+), 691 deletions(-) delete mode 100644 plugins/modules/common/check_roles.py delete mode 100644 plugins/modules/common/get_credentials.py delete mode 100644 plugins/modules/common/read_run_map.py delete mode 100644 plugins/modules/common/run_map.py delete mode 100644 plugins/modules/dtc/add_device_check.py delete mode 100644 plugins/modules/dtc/diff_model_changes.py delete mode 100644 plugins/modules/dtc/update_switch_hostname_policy.py delete mode 100644 plugins/modules/dtc/verify_tags.py delete mode 100644 plugins/modules/dtc/vpc_pair_check.py delete mode 100644 plugins/modules/dtd/prepare_service_model.py delete mode 100644 plugins/modules/test/inventory.py diff --git a/plugins/modules/common/check_roles.py b/plugins/modules/common/check_roles.py deleted file mode 100644 index be95d9111..000000000 --- a/plugins/modules/common/check_roles.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function - - -DOCUMENTATION = """ ---- -module: prep_001_list_defaults -short_description: Prepare action plugin to default any emptry or nested list in the data model. -version_added: "0.1.0" -author: Cisco Systems -description: -- Prepare action plugin to default any emptry or nested list in the data model. -options: - inventory_hostname: - description: - - Ansible inventory_hostname. - required: true - type: str - hostvars: - description: - - Ansible runtime hostvars data. - required: true - type: dict - model_data: - description: - - The path to the data dir. - required: true - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.prepare_service_model: - inventory_hostname: "{{ inventory_hostname }}" - hostvars: "{{ hostvars }}" - model_data: "{{ model_data['data'] }}" - register: smd - -""" \ No newline at end of file diff --git a/plugins/modules/common/get_credentials.py b/plugins/modules/common/get_credentials.py deleted file mode 100644 index be95d9111..000000000 --- a/plugins/modules/common/get_credentials.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function - - -DOCUMENTATION = """ ---- -module: prep_001_list_defaults -short_description: Prepare action plugin to default any emptry or nested list in the data model. -version_added: "0.1.0" -author: Cisco Systems -description: -- Prepare action plugin to default any emptry or nested list in the data model. -options: - inventory_hostname: - description: - - Ansible inventory_hostname. - required: true - type: str - hostvars: - description: - - Ansible runtime hostvars data. - required: true - type: dict - model_data: - description: - - The path to the data dir. - required: true - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.prepare_service_model: - inventory_hostname: "{{ inventory_hostname }}" - hostvars: "{{ hostvars }}" - model_data: "{{ model_data['data'] }}" - register: smd - -""" \ No newline at end of file diff --git a/plugins/modules/common/nac_dc_validate.py b/plugins/modules/common/nac_dc_validate.py index 706041107..336df6736 100644 --- a/plugins/modules/common/nac_dc_validate.py +++ b/plugins/modules/common/nac_dc_validate.py @@ -27,7 +27,7 @@ module: nac_dc_validate short_description: Prepare action plugin to validate the data model against the schema and return the rendered data model. version_added: "0.1.0" -author: Cisco Systems +author: Mike Wiebe & Matt Tarkington description: - Prepare action plugin to validate the data model against the schema and return the rendered data model. options: diff --git a/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py b/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py index 8ab8ca977..a8009cbb7 100644 --- a/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py +++ b/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py @@ -27,7 +27,7 @@ module: prep_001_list_defaults short_description: Prepare action plugin for list and nested list elementes of the extended data model. version_added: "0.1.0" -author: Cisco Systems +author: Mike Wiebe description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for list and nested list elementes of the extended data model. diff --git a/plugins/modules/common/prepare_plugins/prep_101_global.py b/plugins/modules/common/prepare_plugins/prep_101_global.py index 99e6296ca..21f3a9080 100644 --- a/plugins/modules/common/prepare_plugins/prep_101_global.py +++ b/plugins/modules/common/prepare_plugins/prep_101_global.py @@ -27,7 +27,7 @@ module: prep_101_global short_description: Prepare action plugin for global elementes of the extended data model. version_added: "0.1.0" -author: Cisco Systems +author: Mike Wiebe description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for global elementes of the extended data model. diff --git a/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py b/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py index ce86cd535..d4e4859ae 100644 --- a/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py +++ b/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py @@ -27,7 +27,7 @@ module: prep_103_topology_switches short_description: Prepare action plugin for topology elementes of the extended data model. version_added: "0.1.0" -author: Cisco Systems +author: Rameez Rahim description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for topology elementes of the extended data model. diff --git a/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py b/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py index e1520412e..67bcc2119 100644 --- a/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py +++ b/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py @@ -27,7 +27,7 @@ module: prep_104_fabric_overlay_services short_description: Prepare action plugin for overlay vrf & network elementes of the extended data model. version_added: "0.1.0" -author: Cisco Systems +author: Matt Tarkington description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for overlay vrf & network elementes of the extended data model. diff --git a/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py b/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py index 5dc09271f..84fefd670 100644 --- a/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py +++ b/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py @@ -27,7 +27,7 @@ module: prep_105_topology_interfaces short_description: Prepare action plugin for interface elementes of the extended data model. version_added: "0.1.0" -author: Cisco Systems +author: Rameez Rahim description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for interface elementes of the extended data model. diff --git a/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py b/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py index 9cfd5c273..e607e8236 100644 --- a/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py +++ b/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py @@ -27,7 +27,7 @@ module: prep_106_topology_vpc_interfaces short_description: Prepare action plugin for Cisco vPC interface elementes of the extended data model. version_added: "0.1.0" -author: Cisco Systems +author: Rameez Rahim description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for Cisco vPC interface elementes of the extended data model. diff --git a/plugins/modules/common/prepare_plugins/prep_107_policy.py b/plugins/modules/common/prepare_plugins/prep_107_policy.py index eb21449b7..fd2301de3 100644 --- a/plugins/modules/common/prepare_plugins/prep_107_policy.py +++ b/plugins/modules/common/prepare_plugins/prep_107_policy.py @@ -27,7 +27,7 @@ module: prep_107_policy short_description: Prepare action plugin for policy elementes of the extended data model. version_added: "0.1.0" -author: Cisco Systems +author: Matt Tarkington description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for policy elementes of the extended data model. diff --git a/plugins/modules/common/prepare_service_model.py b/plugins/modules/common/prepare_service_model.py index c6c288259..0329b3c95 100644 --- a/plugins/modules/common/prepare_service_model.py +++ b/plugins/modules/common/prepare_service_model.py @@ -27,7 +27,7 @@ module: prepare_service_model short_description: Prepare action plugin to prepare extended runtime data model. version_added: "0.1.0" -author: Cisco Systems +author: Mike Wiebe description: - Prepare action plugin to prepare extended runtime data model. - Additional prepare action plugins are invoked for different parts of the data model. diff --git a/plugins/modules/common/read_run_map.py b/plugins/modules/common/read_run_map.py deleted file mode 100644 index be95d9111..000000000 --- a/plugins/modules/common/read_run_map.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function - - -DOCUMENTATION = """ ---- -module: prep_001_list_defaults -short_description: Prepare action plugin to default any emptry or nested list in the data model. -version_added: "0.1.0" -author: Cisco Systems -description: -- Prepare action plugin to default any emptry or nested list in the data model. -options: - inventory_hostname: - description: - - Ansible inventory_hostname. - required: true - type: str - hostvars: - description: - - Ansible runtime hostvars data. - required: true - type: dict - model_data: - description: - - The path to the data dir. - required: true - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.prepare_service_model: - inventory_hostname: "{{ inventory_hostname }}" - hostvars: "{{ hostvars }}" - model_data: "{{ model_data['data'] }}" - register: smd - -""" \ No newline at end of file diff --git a/plugins/modules/common/run_map.py b/plugins/modules/common/run_map.py deleted file mode 100644 index be95d9111..000000000 --- a/plugins/modules/common/run_map.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function - - -DOCUMENTATION = """ ---- -module: prep_001_list_defaults -short_description: Prepare action plugin to default any emptry or nested list in the data model. -version_added: "0.1.0" -author: Cisco Systems -description: -- Prepare action plugin to default any emptry or nested list in the data model. -options: - inventory_hostname: - description: - - Ansible inventory_hostname. - required: true - type: str - hostvars: - description: - - Ansible runtime hostvars data. - required: true - type: dict - model_data: - description: - - The path to the data dir. - required: true - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.prepare_service_model: - inventory_hostname: "{{ inventory_hostname }}" - hostvars: "{{ hostvars }}" - model_data: "{{ model_data['data'] }}" - register: smd - -""" \ No newline at end of file diff --git a/plugins/modules/dtc/add_device_check.py b/plugins/modules/dtc/add_device_check.py deleted file mode 100644 index be95d9111..000000000 --- a/plugins/modules/dtc/add_device_check.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function - - -DOCUMENTATION = """ ---- -module: prep_001_list_defaults -short_description: Prepare action plugin to default any emptry or nested list in the data model. -version_added: "0.1.0" -author: Cisco Systems -description: -- Prepare action plugin to default any emptry or nested list in the data model. -options: - inventory_hostname: - description: - - Ansible inventory_hostname. - required: true - type: str - hostvars: - description: - - Ansible runtime hostvars data. - required: true - type: dict - model_data: - description: - - The path to the data dir. - required: true - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.prepare_service_model: - inventory_hostname: "{{ inventory_hostname }}" - hostvars: "{{ hostvars }}" - model_data: "{{ model_data['data'] }}" - register: smd - -""" \ No newline at end of file diff --git a/plugins/modules/dtc/diff_model_changes.py b/plugins/modules/dtc/diff_model_changes.py deleted file mode 100644 index be95d9111..000000000 --- a/plugins/modules/dtc/diff_model_changes.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function - - -DOCUMENTATION = """ ---- -module: prep_001_list_defaults -short_description: Prepare action plugin to default any emptry or nested list in the data model. -version_added: "0.1.0" -author: Cisco Systems -description: -- Prepare action plugin to default any emptry or nested list in the data model. -options: - inventory_hostname: - description: - - Ansible inventory_hostname. - required: true - type: str - hostvars: - description: - - Ansible runtime hostvars data. - required: true - type: dict - model_data: - description: - - The path to the data dir. - required: true - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.prepare_service_model: - inventory_hostname: "{{ inventory_hostname }}" - hostvars: "{{ hostvars }}" - model_data: "{{ model_data['data'] }}" - register: smd - -""" \ No newline at end of file diff --git a/plugins/modules/dtc/update_switch_hostname_policy.py b/plugins/modules/dtc/update_switch_hostname_policy.py deleted file mode 100644 index be95d9111..000000000 --- a/plugins/modules/dtc/update_switch_hostname_policy.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function - - -DOCUMENTATION = """ ---- -module: prep_001_list_defaults -short_description: Prepare action plugin to default any emptry or nested list in the data model. -version_added: "0.1.0" -author: Cisco Systems -description: -- Prepare action plugin to default any emptry or nested list in the data model. -options: - inventory_hostname: - description: - - Ansible inventory_hostname. - required: true - type: str - hostvars: - description: - - Ansible runtime hostvars data. - required: true - type: dict - model_data: - description: - - The path to the data dir. - required: true - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.prepare_service_model: - inventory_hostname: "{{ inventory_hostname }}" - hostvars: "{{ hostvars }}" - model_data: "{{ model_data['data'] }}" - register: smd - -""" \ No newline at end of file diff --git a/plugins/modules/dtc/verify_tags.py b/plugins/modules/dtc/verify_tags.py deleted file mode 100644 index be95d9111..000000000 --- a/plugins/modules/dtc/verify_tags.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function - - -DOCUMENTATION = """ ---- -module: prep_001_list_defaults -short_description: Prepare action plugin to default any emptry or nested list in the data model. -version_added: "0.1.0" -author: Cisco Systems -description: -- Prepare action plugin to default any emptry or nested list in the data model. -options: - inventory_hostname: - description: - - Ansible inventory_hostname. - required: true - type: str - hostvars: - description: - - Ansible runtime hostvars data. - required: true - type: dict - model_data: - description: - - The path to the data dir. - required: true - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.prepare_service_model: - inventory_hostname: "{{ inventory_hostname }}" - hostvars: "{{ hostvars }}" - model_data: "{{ model_data['data'] }}" - register: smd - -""" \ No newline at end of file diff --git a/plugins/modules/dtc/vpc_pair_check.py b/plugins/modules/dtc/vpc_pair_check.py deleted file mode 100644 index be95d9111..000000000 --- a/plugins/modules/dtc/vpc_pair_check.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function - - -DOCUMENTATION = """ ---- -module: prep_001_list_defaults -short_description: Prepare action plugin to default any emptry or nested list in the data model. -version_added: "0.1.0" -author: Cisco Systems -description: -- Prepare action plugin to default any emptry or nested list in the data model. -options: - inventory_hostname: - description: - - Ansible inventory_hostname. - required: true - type: str - hostvars: - description: - - Ansible runtime hostvars data. - required: true - type: dict - model_data: - description: - - The path to the data dir. - required: true - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.prepare_service_model: - inventory_hostname: "{{ inventory_hostname }}" - hostvars: "{{ hostvars }}" - model_data: "{{ model_data['data'] }}" - register: smd - -""" \ No newline at end of file diff --git a/plugins/modules/dtd/prepare_service_model.py b/plugins/modules/dtd/prepare_service_model.py deleted file mode 100644 index be95d9111..000000000 --- a/plugins/modules/dtd/prepare_service_model.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function - - -DOCUMENTATION = """ ---- -module: prep_001_list_defaults -short_description: Prepare action plugin to default any emptry or nested list in the data model. -version_added: "0.1.0" -author: Cisco Systems -description: -- Prepare action plugin to default any emptry or nested list in the data model. -options: - inventory_hostname: - description: - - Ansible inventory_hostname. - required: true - type: str - hostvars: - description: - - Ansible runtime hostvars data. - required: true - type: dict - model_data: - description: - - The path to the data dir. - required: true - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.prepare_service_model: - inventory_hostname: "{{ inventory_hostname }}" - hostvars: "{{ hostvars }}" - model_data: "{{ model_data['data'] }}" - register: smd - -""" \ No newline at end of file diff --git a/plugins/modules/test/inventory.py b/plugins/modules/test/inventory.py deleted file mode 100644 index be95d9111..000000000 --- a/plugins/modules/test/inventory.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function - - -DOCUMENTATION = """ ---- -module: prep_001_list_defaults -short_description: Prepare action plugin to default any emptry or nested list in the data model. -version_added: "0.1.0" -author: Cisco Systems -description: -- Prepare action plugin to default any emptry or nested list in the data model. -options: - inventory_hostname: - description: - - Ansible inventory_hostname. - required: true - type: str - hostvars: - description: - - Ansible runtime hostvars data. - required: true - type: dict - model_data: - description: - - The path to the data dir. - required: true - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.prepare_service_model: - inventory_hostname: "{{ inventory_hostname }}" - hostvars: "{{ hostvars }}" - model_data: "{{ model_data['data'] }}" - register: smd - -""" \ No newline at end of file From fad265dfc06e5920193f3ddecadc17f4cf5b9772 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 06:18:26 -0400 Subject: [PATCH 03/20] fix errors and retest --- plugins/modules/common/nac_dc_validate.py | 3 ++- .../modules/common/prepare_plugins/prep_001_list_defaults.py | 3 ++- plugins/modules/common/prepare_plugins/prep_101_global.py | 3 ++- .../common/prepare_plugins/prep_103_topology_switches.py | 3 ++- .../common/prepare_plugins/prep_104_fabric_overlay_services.py | 3 ++- .../common/prepare_plugins/prep_105_topology_interfaces.py | 3 ++- .../common/prepare_plugins/prep_106_topology_vpc_interfaces.py | 3 ++- plugins/modules/common/prepare_plugins/prep_107_policy.py | 3 ++- plugins/modules/common/prepare_service_model.py | 3 ++- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/plugins/modules/common/nac_dc_validate.py b/plugins/modules/common/nac_dc_validate.py index 336df6736..148cd1ce1 100644 --- a/plugins/modules/common/nac_dc_validate.py +++ b/plugins/modules/common/nac_dc_validate.py @@ -20,6 +20,7 @@ # SPDX-License-Identifier: MIT from __future__ import absolute_import, division, print_function +__metaclass__ = type DOCUMENTATION = """ @@ -59,4 +60,4 @@ rules: "{{ rules_path }}" register: model_data -""" \ No newline at end of file +""" diff --git a/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py b/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py index a8009cbb7..1775ef4a1 100644 --- a/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py +++ b/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py @@ -20,6 +20,7 @@ # SPDX-License-Identifier: MIT from __future__ import absolute_import, division, print_function +__metaclass__ = type DOCUMENTATION = """ @@ -60,4 +61,4 @@ model_data: "{{ model_data['data'] }}" register: smd -""" \ No newline at end of file +""" diff --git a/plugins/modules/common/prepare_plugins/prep_101_global.py b/plugins/modules/common/prepare_plugins/prep_101_global.py index 21f3a9080..e77dba9d5 100644 --- a/plugins/modules/common/prepare_plugins/prep_101_global.py +++ b/plugins/modules/common/prepare_plugins/prep_101_global.py @@ -20,6 +20,7 @@ # SPDX-License-Identifier: MIT from __future__ import absolute_import, division, print_function +__metaclass__ = type DOCUMENTATION = """ @@ -60,4 +61,4 @@ model_data: "{{ model_data['data'] }}" register: smd -""" \ No newline at end of file +""" diff --git a/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py b/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py index d4e4859ae..c9aadaf5e 100644 --- a/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py +++ b/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py @@ -20,6 +20,7 @@ # SPDX-License-Identifier: MIT from __future__ import absolute_import, division, print_function +__metaclass__ = type DOCUMENTATION = """ @@ -60,4 +61,4 @@ model_data: "{{ model_data['data'] }}" register: smd -""" \ No newline at end of file +""" diff --git a/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py b/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py index 67bcc2119..ccd690806 100644 --- a/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py +++ b/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py @@ -20,6 +20,7 @@ # SPDX-License-Identifier: MIT from __future__ import absolute_import, division, print_function +__metaclass__ = type DOCUMENTATION = """ @@ -61,4 +62,4 @@ model_data: "{{ model_data['data'] }}" register: smd -""" \ No newline at end of file +""" diff --git a/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py b/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py index 84fefd670..5d38a5de0 100644 --- a/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py +++ b/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py @@ -20,6 +20,7 @@ # SPDX-License-Identifier: MIT from __future__ import absolute_import, division, print_function +__metaclass__ = type DOCUMENTATION = """ @@ -61,4 +62,4 @@ model_data: "{{ model_data['data'] }}" register: smd -""" \ No newline at end of file +""" diff --git a/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py b/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py index e607e8236..744ab5589 100644 --- a/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py +++ b/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py @@ -20,6 +20,7 @@ # SPDX-License-Identifier: MIT from __future__ import absolute_import, division, print_function +__metaclass__ = type DOCUMENTATION = """ @@ -61,4 +62,4 @@ model_data: "{{ model_data['data'] }}" register: smd -""" \ No newline at end of file +""" diff --git a/plugins/modules/common/prepare_plugins/prep_107_policy.py b/plugins/modules/common/prepare_plugins/prep_107_policy.py index fd2301de3..097e8071d 100644 --- a/plugins/modules/common/prepare_plugins/prep_107_policy.py +++ b/plugins/modules/common/prepare_plugins/prep_107_policy.py @@ -20,6 +20,7 @@ # SPDX-License-Identifier: MIT from __future__ import absolute_import, division, print_function +__metaclass__ = type DOCUMENTATION = """ @@ -61,4 +62,4 @@ model_data: "{{ model_data['data'] }}" register: smd -""" \ No newline at end of file +""" diff --git a/plugins/modules/common/prepare_service_model.py b/plugins/modules/common/prepare_service_model.py index 0329b3c95..643b7908e 100644 --- a/plugins/modules/common/prepare_service_model.py +++ b/plugins/modules/common/prepare_service_model.py @@ -20,6 +20,7 @@ # SPDX-License-Identifier: MIT from __future__ import absolute_import, division, print_function +__metaclass__ = type DOCUMENTATION = """ @@ -60,4 +61,4 @@ model_data: "{{ model_data['data'] }}" register: smd -""" \ No newline at end of file +""" From 4a5c4e42fb2482b6797246358e32f58151a66ee2 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 06:28:16 -0400 Subject: [PATCH 04/20] test ignore wildcard --- tests/sanity/ignore-2.14.txt | 1 + tests/sanity/ignore-2.15.txt | 1 + tests/sanity/ignore-2.16.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 2dfddfb6d..d79f4b4ec 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1,3 +1,4 @@ +plugins/modules/* validate-modules:missing-gplv3-license # ignore license check plugins/action/common/check_roles.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/get_credentials.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/run_map.py action-plugin-docs # action plugin has no matching module to provide documentation diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 2dfddfb6d..d79f4b4ec 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -1,3 +1,4 @@ +plugins/modules/* validate-modules:missing-gplv3-license # ignore license check plugins/action/common/check_roles.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/get_credentials.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/run_map.py action-plugin-docs # action plugin has no matching module to provide documentation diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 2dfddfb6d..d79f4b4ec 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -1,3 +1,4 @@ +plugins/modules/* validate-modules:missing-gplv3-license # ignore license check plugins/action/common/check_roles.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/get_credentials.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/run_map.py action-plugin-docs # action plugin has no matching module to provide documentation From 6410cfca9c7bf08c03d9ab7e997ab8ac9a62b206 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 06:35:03 -0400 Subject: [PATCH 05/20] fix error and retest --- plugins/modules/common/nac_dc_validate.py | 4 +++- .../modules/common/prepare_plugins/prep_001_list_defaults.py | 2 +- plugins/modules/common/prepare_plugins/prep_101_global.py | 2 +- .../common/prepare_plugins/prep_103_topology_switches.py | 2 +- .../prepare_plugins/prep_104_fabric_overlay_services.py | 2 +- .../common/prepare_plugins/prep_105_topology_interfaces.py | 2 +- .../prepare_plugins/prep_106_topology_vpc_interfaces.py | 2 +- plugins/modules/common/prepare_plugins/prep_107_policy.py | 2 +- plugins/modules/common/prepare_service_model.py | 2 +- tests/sanity/ignore.txt | 1 + 10 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 tests/sanity/ignore.txt diff --git a/plugins/modules/common/nac_dc_validate.py b/plugins/modules/common/nac_dc_validate.py index 148cd1ce1..75c876854 100644 --- a/plugins/modules/common/nac_dc_validate.py +++ b/plugins/modules/common/nac_dc_validate.py @@ -28,7 +28,9 @@ module: nac_dc_validate short_description: Prepare action plugin to validate the data model against the schema and return the rendered data model. version_added: "0.1.0" -author: Mike Wiebe & Matt Tarkington +author: + - Mike Wiebe (@mikewiebe) + - Matt Tarkington (@mtarking) description: - Prepare action plugin to validate the data model against the schema and return the rendered data model. options: diff --git a/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py b/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py index 1775ef4a1..4fe2a1b74 100644 --- a/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py +++ b/plugins/modules/common/prepare_plugins/prep_001_list_defaults.py @@ -28,7 +28,7 @@ module: prep_001_list_defaults short_description: Prepare action plugin for list and nested list elementes of the extended data model. version_added: "0.1.0" -author: Mike Wiebe +author: Mike Wiebe (@mikewiebe) description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for list and nested list elementes of the extended data model. diff --git a/plugins/modules/common/prepare_plugins/prep_101_global.py b/plugins/modules/common/prepare_plugins/prep_101_global.py index e77dba9d5..ae0791e0e 100644 --- a/plugins/modules/common/prepare_plugins/prep_101_global.py +++ b/plugins/modules/common/prepare_plugins/prep_101_global.py @@ -28,7 +28,7 @@ module: prep_101_global short_description: Prepare action plugin for global elementes of the extended data model. version_added: "0.1.0" -author: Mike Wiebe +author: Mike Wiebe (@mikewiebe) description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for global elementes of the extended data model. diff --git a/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py b/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py index c9aadaf5e..3bd39a6a7 100644 --- a/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py +++ b/plugins/modules/common/prepare_plugins/prep_103_topology_switches.py @@ -28,7 +28,7 @@ module: prep_103_topology_switches short_description: Prepare action plugin for topology elementes of the extended data model. version_added: "0.1.0" -author: Rameez Rahim +author: Rameez Rahim M (@rrahimm) description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for topology elementes of the extended data model. diff --git a/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py b/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py index ccd690806..f97ecda8b 100644 --- a/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py +++ b/plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py @@ -28,7 +28,7 @@ module: prep_104_fabric_overlay_services short_description: Prepare action plugin for overlay vrf & network elementes of the extended data model. version_added: "0.1.0" -author: Matt Tarkington +author: Matt Tarkington (@mtarking) description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for overlay vrf & network elementes of the extended data model. diff --git a/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py b/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py index 5d38a5de0..e6fee1ad2 100644 --- a/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py +++ b/plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py @@ -28,7 +28,7 @@ module: prep_105_topology_interfaces short_description: Prepare action plugin for interface elementes of the extended data model. version_added: "0.1.0" -author: Rameez Rahim +author: Rameez Rahim M (@rrahimm) description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for interface elementes of the extended data model. diff --git a/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py b/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py index 744ab5589..9e91bbf0f 100644 --- a/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py +++ b/plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py @@ -28,7 +28,7 @@ module: prep_106_topology_vpc_interfaces short_description: Prepare action plugin for Cisco vPC interface elementes of the extended data model. version_added: "0.1.0" -author: Rameez Rahim +author: Rameez Rahim M (@rrahimm) description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for Cisco vPC interface elementes of the extended data model. diff --git a/plugins/modules/common/prepare_plugins/prep_107_policy.py b/plugins/modules/common/prepare_plugins/prep_107_policy.py index 097e8071d..e22ace0c9 100644 --- a/plugins/modules/common/prepare_plugins/prep_107_policy.py +++ b/plugins/modules/common/prepare_plugins/prep_107_policy.py @@ -28,7 +28,7 @@ module: prep_107_policy short_description: Prepare action plugin for policy elementes of the extended data model. version_added: "0.1.0" -author: Matt Tarkington +author: Matt Tarkington (@mtarking) description: - Invoked from the main prepare action plugin prepare_service_model. - Prepare action plugin for policy elementes of the extended data model. diff --git a/plugins/modules/common/prepare_service_model.py b/plugins/modules/common/prepare_service_model.py index 643b7908e..125bd9c27 100644 --- a/plugins/modules/common/prepare_service_model.py +++ b/plugins/modules/common/prepare_service_model.py @@ -28,7 +28,7 @@ module: prepare_service_model short_description: Prepare action plugin to prepare extended runtime data model. version_added: "0.1.0" -author: Mike Wiebe +author: Mike Wiebe (@mikewiebe) description: - Prepare action plugin to prepare extended runtime data model. - Additional prepare action plugins are invoked for different parts of the data model. diff --git a/tests/sanity/ignore.txt b/tests/sanity/ignore.txt new file mode 100644 index 000000000..8e9628f03 --- /dev/null +++ b/tests/sanity/ignore.txt @@ -0,0 +1 @@ +plugins/modules/* validate-modules:missing-gplv3-license # ignore license check From 55a81aae6ce7b5a1fa8856960cc19e767ab37815 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 06:45:44 -0400 Subject: [PATCH 06/20] update ignores --- tests/sanity/ignore-2.14.txt | 10 +++++++++- tests/sanity/ignore-2.15.txt | 10 +++++++++- tests/sanity/ignore-2.16.txt | 10 +++++++++- tests/sanity/ignore.txt | 1 - 4 files changed, 27 insertions(+), 4 deletions(-) delete mode 100644 tests/sanity/ignore.txt diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index d79f4b4ec..85553c480 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1,4 +1,12 @@ -plugins/modules/* validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/nac_dc_validate.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_001_list_defaults.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_101_global.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_103_topology_switches.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_107_policy.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_service_model.py validate-modules:missing-gplv3-license # ignore license check plugins/action/common/check_roles.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/get_credentials.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/run_map.py action-plugin-docs # action plugin has no matching module to provide documentation diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index d79f4b4ec..85553c480 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -1,4 +1,12 @@ -plugins/modules/* validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/nac_dc_validate.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_001_list_defaults.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_101_global.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_103_topology_switches.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_107_policy.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_service_model.py validate-modules:missing-gplv3-license # ignore license check plugins/action/common/check_roles.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/get_credentials.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/run_map.py action-plugin-docs # action plugin has no matching module to provide documentation diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index d79f4b4ec..85553c480 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -1,4 +1,12 @@ -plugins/modules/* validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/nac_dc_validate.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_001_list_defaults.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_101_global.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_103_topology_switches.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_104_fabric_overlay_services.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_plugins/prep_107_policy.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/prepare_service_model.py validate-modules:missing-gplv3-license # ignore license check plugins/action/common/check_roles.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/get_credentials.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/run_map.py action-plugin-docs # action plugin has no matching module to provide documentation diff --git a/tests/sanity/ignore.txt b/tests/sanity/ignore.txt deleted file mode 100644 index 8e9628f03..000000000 --- a/tests/sanity/ignore.txt +++ /dev/null @@ -1 +0,0 @@ -plugins/modules/* validate-modules:missing-gplv3-license # ignore license check From 017c261c2732fb35380c9e4adfcc3441a5163995 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 06:53:26 -0400 Subject: [PATCH 07/20] refactor dir structure for plugin helper --- plugins/action/common/prepare_plugins/prep_001_list_defaults.py | 2 +- plugins/action/common/prepare_plugins/prep_101_global.py | 1 + .../common/prepare_plugins/prep_106_topology_vpc_interfaces.py | 2 ++ plugins/modules/.gitkeep | 0 plugins/plugin_utils/.gitkeep | 0 plugins/{action => plugin_utils}/helper_functions.py | 0 6 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 plugins/modules/.gitkeep create mode 100644 plugins/plugin_utils/.gitkeep rename plugins/{action => plugin_utils}/helper_functions.py (100%) diff --git a/plugins/action/common/prepare_plugins/prep_001_list_defaults.py b/plugins/action/common/prepare_plugins/prep_001_list_defaults.py index c3fb522d2..75a5f776c 100644 --- a/plugins/action/common/prepare_plugins/prep_001_list_defaults.py +++ b/plugins/action/common/prepare_plugins/prep_001_list_defaults.py @@ -20,7 +20,7 @@ # SPDX-License-Identifier: MIT -from ...helper_functions import data_model_key_check +from ....plugin_utils.helper_functions import data_model_key_check def update_nested_dict(nested_dict, keys, new_value): diff --git a/plugins/action/common/prepare_plugins/prep_101_global.py b/plugins/action/common/prepare_plugins/prep_101_global.py index 1a675eb17..00ddba43c 100644 --- a/plugins/action/common/prepare_plugins/prep_101_global.py +++ b/plugins/action/common/prepare_plugins/prep_101_global.py @@ -19,6 +19,7 @@ # # SPDX-License-Identifier: MIT + class PreparePlugin: def __init__(self, **kwargs): self.kwargs = kwargs diff --git a/plugins/action/common/prepare_plugins/prep_106_topology_vpc_interfaces.py b/plugins/action/common/prepare_plugins/prep_106_topology_vpc_interfaces.py index 1a2cdfaf7..e4133682b 100644 --- a/plugins/action/common/prepare_plugins/prep_106_topology_vpc_interfaces.py +++ b/plugins/action/common/prepare_plugins/prep_106_topology_vpc_interfaces.py @@ -22,6 +22,8 @@ # Group vPC interfaces by vpc_peers, vpc_id and switch_name # This helps in identifying vPC interfaces for a given vpc_peer, vpc_id and switch_name # Reduces the need to loop through all interfaces to find vPC interfaces in Jinja2 templates + + class PreparePlugin: def __init__(self, **kwargs): self.kwargs = kwargs diff --git a/plugins/modules/.gitkeep b/plugins/modules/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/plugin_utils/.gitkeep b/plugins/plugin_utils/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/action/helper_functions.py b/plugins/plugin_utils/helper_functions.py similarity index 100% rename from plugins/action/helper_functions.py rename to plugins/plugin_utils/helper_functions.py From e9ddf95085b0648aa5bad76c8a3cb76eac87f590 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 06:59:18 -0400 Subject: [PATCH 08/20] update ignores --- plugins/action/dtc/update_switch_hostname_policy.py | 2 +- tests/sanity/ignore-2.14.txt | 1 - tests/sanity/ignore-2.15.txt | 1 - tests/sanity/ignore-2.16.txt | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/action/dtc/update_switch_hostname_policy.py b/plugins/action/dtc/update_switch_hostname_policy.py index 450c2b23e..a672b2c3f 100644 --- a/plugins/action/dtc/update_switch_hostname_policy.py +++ b/plugins/action/dtc/update_switch_hostname_policy.py @@ -25,7 +25,7 @@ __metaclass__ = type from ansible.plugins.action import ActionBase -from ..helper_functions import ndfc_get_switch_policy +from ...plugin_utils.helper_functions import ndfc_get_switch_policy class ActionModule(ActionBase): diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 85553c480..b7a14ff95 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -18,7 +18,6 @@ plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtd/prepare_service_model.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/test/inventory.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/helper_functions.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/nac_dc_validate.py import-3.10!skip plugins/action/test/inventory.py import-3.10!skip plugins/action/common/run_map.py import-3.10!skip diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 85553c480..b7a14ff95 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -18,7 +18,6 @@ plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtd/prepare_service_model.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/test/inventory.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/helper_functions.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/nac_dc_validate.py import-3.10!skip plugins/action/test/inventory.py import-3.10!skip plugins/action/common/run_map.py import-3.10!skip diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 85553c480..b7a14ff95 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -18,7 +18,6 @@ plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtd/prepare_service_model.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/test/inventory.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/helper_functions.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/nac_dc_validate.py import-3.10!skip plugins/action/test/inventory.py import-3.10!skip plugins/action/common/run_map.py import-3.10!skip From 944522ba98d71c2c591d6bb1c55a649a76bef314 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 07:07:27 -0400 Subject: [PATCH 09/20] remove unused plugins and update ignores --- plugins/action/dtd/prepare_service_model.py | 20 --------- plugins/action/test/inventory.py | 48 --------------------- tests/sanity/ignore-2.14.txt | 3 -- tests/sanity/ignore-2.15.txt | 3 -- tests/sanity/ignore-2.16.txt | 3 -- 5 files changed, 77 deletions(-) delete mode 100644 plugins/action/dtd/prepare_service_model.py delete mode 100644 plugins/action/test/inventory.py diff --git a/plugins/action/dtd/prepare_service_model.py b/plugins/action/dtd/prepare_service_model.py deleted file mode 100644 index 2f05fd825..000000000 --- a/plugins/action/dtd/prepare_service_model.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT diff --git a/plugins/action/test/inventory.py b/plugins/action/test/inventory.py deleted file mode 100644 index 5a0b15fe5..000000000 --- a/plugins/action/test/inventory.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function - - -__metaclass__ = type - -from ansible.utils.display import Display -from ansible.plugins.action import ActionBase - -display = Display() - - -class ActionModule(ActionBase): - - def run(self, tmp=None, task_vars=None): - results = super(ActionModule, self).run(tmp, task_vars) - results['failed'] = False - - test_data = self._task.args['test_data']['response'] - model_data = self._task.args['model_data'] - - num_fabric_devices = len(test_data) - num_model_devices = len(model_data['vxlan']['topology']['switches']) - if num_fabric_devices != num_model_devices: - results['msg'] = 'There should be {0} switches in the fabric but only found {1}'.format(num_model_devices, num_fabric_devices) - results['failed'] = True - - return results diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index b7a14ff95..763bec7b3 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -16,10 +16,7 @@ plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no m plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtd/prepare_service_model.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/test/inventory.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/nac_dc_validate.py import-3.10!skip -plugins/action/test/inventory.py import-3.10!skip plugins/action/common/run_map.py import-3.10!skip plugins/action/common/read_run_map.py import-3.10!skip plugins/action/dtc/diff_model_changes.py import-3.10!skip diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index b7a14ff95..763bec7b3 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -16,10 +16,7 @@ plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no m plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtd/prepare_service_model.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/test/inventory.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/nac_dc_validate.py import-3.10!skip -plugins/action/test/inventory.py import-3.10!skip plugins/action/common/run_map.py import-3.10!skip plugins/action/common/read_run_map.py import-3.10!skip plugins/action/dtc/diff_model_changes.py import-3.10!skip diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index b7a14ff95..763bec7b3 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -16,10 +16,7 @@ plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no m plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtd/prepare_service_model.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/test/inventory.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/nac_dc_validate.py import-3.10!skip -plugins/action/test/inventory.py import-3.10!skip plugins/action/common/run_map.py import-3.10!skip plugins/action/common/read_run_map.py import-3.10!skip plugins/action/dtc/diff_model_changes.py import-3.10!skip From 56818e2d88b885b446012e23424bfa5b01af9b2a Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 07:25:59 -0400 Subject: [PATCH 10/20] update ignores --- tests/sanity/ignore-2.14.txt | 4 ---- tests/sanity/ignore-2.15.txt | 4 ---- tests/sanity/ignore-2.16.txt | 4 ---- 3 files changed, 12 deletions(-) diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 763bec7b3..152d3f897 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -16,7 +16,3 @@ plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no m plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/nac_dc_validate.py import-3.10!skip -plugins/action/common/run_map.py import-3.10!skip -plugins/action/common/read_run_map.py import-3.10!skip -plugins/action/dtc/diff_model_changes.py import-3.10!skip diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 763bec7b3..152d3f897 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -16,7 +16,3 @@ plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no m plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/nac_dc_validate.py import-3.10!skip -plugins/action/common/run_map.py import-3.10!skip -plugins/action/common/read_run_map.py import-3.10!skip -plugins/action/dtc/diff_model_changes.py import-3.10!skip diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 763bec7b3..152d3f897 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -16,7 +16,3 @@ plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no m plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/nac_dc_validate.py import-3.10!skip -plugins/action/common/run_map.py import-3.10!skip -plugins/action/common/read_run_map.py import-3.10!skip -plugins/action/dtc/diff_model_changes.py import-3.10!skip From 25318f88ca31f7cc28af559bf9d676292e722a32 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 07:34:53 -0400 Subject: [PATCH 11/20] update gh actions --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index beb5eb661..e4280f6b8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,6 +61,7 @@ jobs: - name: Upgrade pip run: | pip install --upgrade pip + pip install iac-validate==0.2.5 - name: Install ansible-base (v${{ matrix.ansible }}) run: pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check From 94fabb5d596a2a2ced7c33cca937f6d63fea72f6 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 08:11:36 -0400 Subject: [PATCH 12/20] add more common modules for action plugins --- .github/workflows/main.yml | 1 - plugins/action/common/check_roles.py | 1 - plugins/action/common/nac_dc_validate.py | 16 ++++- plugins/modules/common/check_roles.py | 51 ++++++++++++++++ plugins/modules/common/get_credentials.py | 52 ++++++++++++++++ plugins/modules/common/read_run_map.py | 51 ++++++++++++++++ plugins/modules/common/run_map.py | 61 +++++++++++++++++++ .../tasks/manage_model_files_previous.yml | 2 +- tests/sanity/ignore-2.14.txt | 9 +-- tests/sanity/ignore-2.15.txt | 9 +-- tests/sanity/ignore-2.16.txt | 9 +-- 11 files changed, 244 insertions(+), 18 deletions(-) create mode 100644 plugins/modules/common/check_roles.py create mode 100644 plugins/modules/common/get_credentials.py create mode 100644 plugins/modules/common/read_run_map.py create mode 100644 plugins/modules/common/run_map.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e4280f6b8..beb5eb661 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,7 +61,6 @@ jobs: - name: Upgrade pip run: | pip install --upgrade pip - pip install iac-validate==0.2.5 - name: Install ansible-base (v${{ matrix.ansible }}) run: pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check diff --git a/plugins/action/common/check_roles.py b/plugins/action/common/check_roles.py index 64fb0a6dc..d2bc24a96 100644 --- a/plugins/action/common/check_roles.py +++ b/plugins/action/common/check_roles.py @@ -33,7 +33,6 @@ class ActionModule(ActionBase): def run(self, tmp=None, task_vars=None): - # self._supports_async = True results = super(ActionModule, self).run(tmp, task_vars) results['save_previous'] = False diff --git a/plugins/action/common/nac_dc_validate.py b/plugins/action/common/nac_dc_validate.py index ade0a690d..d8ec73aef 100644 --- a/plugins/action/common/nac_dc_validate.py +++ b/plugins/action/common/nac_dc_validate.py @@ -26,10 +26,17 @@ from ansible.utils.display import Display from ansible.plugins.action import ActionBase +from ansible.errors import AnsibleError + +try: + import iac_validate.validator + from iac_validate.yaml import load_yaml_files + from iac_validate.cli.options import DEFAULT_SCHEMA +except ImportError as imp_exc: + IAC_VALIDATE_IMPORT_ERROR = imp_exc +else: + IAC_VALIDATE_IMPORT_ERROR = None -import iac_validate.validator -from iac_validate.yaml import load_yaml_files -from iac_validate.cli.options import DEFAULT_SCHEMA import os display = Display() @@ -43,6 +50,9 @@ def run(self, tmp=None, task_vars=None): results['msg'] = None results['data'] = {} + if IAC_VALIDATE_IMPORT_ERROR: + raise AnsibleError('iac-validate must be installed to use this plugin') from IAC_VALIDATE_IMPORT_ERROR + schema = self._task.args.get('schema') rules = self._task.args.get('rules') mdata = self._task.args.get('mdata') diff --git a/plugins/modules/common/check_roles.py b/plugins/modules/common/check_roles.py new file mode 100644 index 000000000..071d3e85b --- /dev/null +++ b/plugins/modules/common/check_roles.py @@ -0,0 +1,51 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + + +DOCUMENTATION = """ +--- +module: check_roles +short_description: Action plugin to check roles for create or remove. +version_added: "0.2.0" +author: Mike Wiebe (@mikewiebe) +description: +- Action plugin to check roles for create or remove. +options: + role_list: + description: + - List of roles. + required: true + type: list +""" + +EXAMPLES = """ + +# Perform Role Check + +- name: Check Roles + cisco.nac_dc_vxlan.common.check_roles: + role_list: "{{ role_names }}" + register: check_roles + +""" diff --git a/plugins/modules/common/get_credentials.py b/plugins/modules/common/get_credentials.py new file mode 100644 index 000000000..58fedf779 --- /dev/null +++ b/plugins/modules/common/get_credentials.py @@ -0,0 +1,52 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + + +DOCUMENTATION = """ +--- +module: get_credentials +short_description: Action plugin to get NDFC switch credentials and update inventory list. +version_added: "0.1.0" +author: Mike Wiebe (@mikewiebe) +description: +- Action plugin to get NDFC switch credentials and update inventory list. +options: + inv_list: + description: + - Inventory list. + required: true + type: list +""" + +EXAMPLES = """ + +# Get Collection NDFC Switch Credentials and Update Inventory List + +- name: Retrieve NDFC Device Username and Password from Group Vars and update inv_config + cisco.nac_dc_vxlan.common.get_credentials: + inv_list: "{{ inv_config }}" + register: updated_inv_config + no_log: true + +""" diff --git a/plugins/modules/common/read_run_map.py b/plugins/modules/common/read_run_map.py new file mode 100644 index 000000000..f6700140f --- /dev/null +++ b/plugins/modules/common/read_run_map.py @@ -0,0 +1,51 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + + +DOCUMENTATION = """ +--- +module: read_run_map +short_description: Action plugin to read run history map from previous runs. +version_added: "0.3.0" +author: Mike Wiebe (@mikewiebe) +description: +- Action plugin to read run history map from previous runs. +options: + model_data: + description: + - The runtime data model, typically the extended data model. + required: true + type: dict +""" + +EXAMPLES = """ + +# Read Run Map From Previous Run + +- name: Read Run Map From Previous Run + cisco.nac_dc_vxlan.common.read_run_map: + model_data: "{{ MD_Extended }}" + register: run_map_read_result + +""" diff --git a/plugins/modules/common/run_map.py b/plugins/modules/common/run_map.py new file mode 100644 index 000000000..21e001ad1 --- /dev/null +++ b/plugins/modules/common/run_map.py @@ -0,0 +1,61 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + + +DOCUMENTATION = """ +--- +module: run_map +short_description: Action plugin used to perform updates to run map for tracking previous run state. +version_added: "0.3.0" +author: Mike Wiebe (@mikewiebe) +description: +- Action plugin used to perform updates to run map for tracking previous run state. +options: + schema: + description: + - The path to the schema file. + required: false + type: str + mdata: + description: + - The path to the model data dir. + required: true + type: dict + rules: + description: + - The path to the rules dir. + required: false + type: str +""" + +EXAMPLES = """ + +# Used to perform updates to run map for tracking previous run state + +- name: Mark Stage Role Create Completed + cisco.nac_dc_vxlan.common.run_map: + stage: role_create_completed + register: run_map + +""" diff --git a/roles/validate/tasks/manage_model_files_previous.yml b/roles/validate/tasks/manage_model_files_previous.yml index 25fa16daf..99b1ccf43 100644 --- a/roles/validate/tasks/manage_model_files_previous.yml +++ b/roles/validate/tasks/manage_model_files_previous.yml @@ -21,7 +21,7 @@ --- -- name: "Check Roles" +- name: Check Roles cisco.nac_dc_vxlan.common.check_roles: role_list: "{{ role_names }}" register: check_roles diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 152d3f897..727b1180b 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -7,12 +7,13 @@ plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py validate- plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/prepare_plugins/prep_107_policy.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/prepare_service_model.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/check_roles.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/get_credentials.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/run_map.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/read_run_map.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/action/common/check_roles.py validate-modules:missing-gplv3-license # ignore license check +plugins/action/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check +plugins/action/common/run_map.py validate-modules:missing-gplv3-license # ignore license check +plugins/action/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/action/common/nac_dc_validate.py import-3.10!skip diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 152d3f897..727b1180b 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -7,12 +7,13 @@ plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py validate- plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/prepare_plugins/prep_107_policy.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/prepare_service_model.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/check_roles.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/get_credentials.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/run_map.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/read_run_map.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/action/common/check_roles.py validate-modules:missing-gplv3-license # ignore license check +plugins/action/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check +plugins/action/common/run_map.py validate-modules:missing-gplv3-license # ignore license check +plugins/action/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/action/common/nac_dc_validate.py import-3.10!skip diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 152d3f897..727b1180b 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -7,12 +7,13 @@ plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py validate- plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/prepare_plugins/prep_107_policy.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/prepare_service_model.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/check_roles.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/get_credentials.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/run_map.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/common/read_run_map.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/action/common/check_roles.py validate-modules:missing-gplv3-license # ignore license check +plugins/action/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check +plugins/action/common/run_map.py validate-modules:missing-gplv3-license # ignore license check +plugins/action/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/action/common/nac_dc_validate.py import-3.10!skip From dd25bda524cba8e80876adc7b4d18a986b0ed456 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 08:15:44 -0400 Subject: [PATCH 13/20] fix typo --- tests/sanity/ignore-2.14.txt | 8 ++++---- tests/sanity/ignore-2.15.txt | 8 ++++---- tests/sanity/ignore-2.16.txt | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 727b1180b..46dd157d9 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -7,10 +7,10 @@ plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py validate- plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/prepare_plugins/prep_107_policy.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/prepare_service_model.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/check_roles.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/run_map.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/check_roles.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 727b1180b..46dd157d9 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -7,10 +7,10 @@ plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py validate- plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/prepare_plugins/prep_107_policy.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/prepare_service_model.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/check_roles.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/run_map.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/check_roles.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 727b1180b..46dd157d9 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -7,10 +7,10 @@ plugins/modules/common/prepare_plugins/prep_105_topology_interfaces.py validate- plugins/modules/common/prepare_plugins/prep_106_topology_vpc_interfaces.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/prepare_plugins/prep_107_policy.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/prepare_service_model.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/check_roles.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/run_map.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/check_roles.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation From 9a16ae7e09065c0754d092d9a9861e67112dd68f Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 08:30:17 -0400 Subject: [PATCH 14/20] add dtc --- plugins/modules/common/check_roles.py | 2 +- plugins/modules/common/get_credentials.py | 2 +- plugins/modules/dtc/add_device_check.py | 65 +++++++++++++++++++ plugins/modules/dtc/diff_model_changes.py | 62 ++++++++++++++++++ .../dtc/update_switch_hostname_policy.py | 62 ++++++++++++++++++ plugins/modules/dtc/verify_tags.py | 58 +++++++++++++++++ plugins/modules/dtc/vpc_pair_check.py | 63 ++++++++++++++++++ tests/sanity/ignore-2.14.txt | 6 +- tests/sanity/ignore-2.15.txt | 6 +- tests/sanity/ignore-2.16.txt | 6 +- 10 files changed, 321 insertions(+), 11 deletions(-) create mode 100644 plugins/modules/dtc/add_device_check.py create mode 100644 plugins/modules/dtc/diff_model_changes.py create mode 100644 plugins/modules/dtc/update_switch_hostname_policy.py create mode 100644 plugins/modules/dtc/verify_tags.py create mode 100644 plugins/modules/dtc/vpc_pair_check.py diff --git a/plugins/modules/common/check_roles.py b/plugins/modules/common/check_roles.py index 071d3e85b..689b3de14 100644 --- a/plugins/modules/common/check_roles.py +++ b/plugins/modules/common/check_roles.py @@ -36,7 +36,7 @@ description: - List of roles. required: true - type: list + type: str """ EXAMPLES = """ diff --git a/plugins/modules/common/get_credentials.py b/plugins/modules/common/get_credentials.py index 58fedf779..a00e74b4c 100644 --- a/plugins/modules/common/get_credentials.py +++ b/plugins/modules/common/get_credentials.py @@ -36,7 +36,7 @@ description: - Inventory list. required: true - type: list + type: str """ EXAMPLES = """ diff --git a/plugins/modules/dtc/add_device_check.py b/plugins/modules/dtc/add_device_check.py new file mode 100644 index 000000000..75c876854 --- /dev/null +++ b/plugins/modules/dtc/add_device_check.py @@ -0,0 +1,65 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + + +DOCUMENTATION = """ +--- +module: nac_dc_validate +short_description: Prepare action plugin to validate the data model against the schema and return the rendered data model. +version_added: "0.1.0" +author: + - Mike Wiebe (@mikewiebe) + - Matt Tarkington (@mtarking) +description: +- Prepare action plugin to validate the data model against the schema and return the rendered data model. +options: + schema: + description: + - The path to the schema file. + required: false + type: str + mdata: + description: + - The path to the model data dir. + required: true + type: dict + rules: + description: + - The path to the rules dir. + required: false + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.nac_dc_validate: + schema: "{{ schema_path }}" + mdata: "{{ data_path }}" + rules: "{{ rules_path }}" + register: model_data + +""" diff --git a/plugins/modules/dtc/diff_model_changes.py b/plugins/modules/dtc/diff_model_changes.py new file mode 100644 index 000000000..51fd9e2d9 --- /dev/null +++ b/plugins/modules/dtc/diff_model_changes.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + + +DOCUMENTATION = """ +--- +module: diff_model_changes +short_description: Action plugin used to diff the previous and current state data files. +version_added: "0.3.0" +author: Mike Wiebe (@mikewiebe) +description: +- Action plugin used to diff the previous and current state data files. +options: + schema: + description: + - The path to the schema file. + required: false + type: str + mdata: + description: + - The path to the model data dir. + required: true + type: dict + rules: + description: + - The path to the rules dir. + required: false + type: str +""" + +EXAMPLES = """ + +# Diffs the previous and current state data files + +- name: Diff Previous and Current Data Files + cisco.nac_dc_vxlan.dtc.diff_model_changes: + file_name_previous: "{{ role_path }}/files/{{ file_name }}.old" + file_name_current: "{{ role_path }}/files/{{ file_name }}" + register: file_diff_result + +""" diff --git a/plugins/modules/dtc/update_switch_hostname_policy.py b/plugins/modules/dtc/update_switch_hostname_policy.py new file mode 100644 index 000000000..8457c82ee --- /dev/null +++ b/plugins/modules/dtc/update_switch_hostname_policy.py @@ -0,0 +1,62 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + + +DOCUMENTATION = """ +--- +module: update_switch_hostname_policy +short_description: Action plugin to parse, build, and return an updated policy payload for updating NDFC switch hostnames based on the data model. +version_added: "0.3.0" +author: Matt Tarkington (@mtarking) +description: +- Action plugin to parse, build, and return an updated policy payload for updating NDFC switch hostnames based on the data model. +options: + mdata: + description: + - The runtime data model, typically the extended data model. + required: true + type: dict + switch_serial_numbers: + description: + - List of switch serial numbers NDFC is managing. + required: true + type: list + template_name: + description: + - NDFC template name. + required: true + type: str +""" + +EXAMPLES = """ + +# Parses, builds, and returns an updated policy payload for updating NDFC switch hostnames based on the data model. + +- name: Build Switch Hostname Policy Payload from Data Model Update + cisco.nac_dc_vxlan.dtc.update_switch_hostname_policy: + model_data: "{{ MD_Extended }}" + switch_serial_numbers: "{{ md_serial_numbers }}" + template_name: host_11_1 + +""" diff --git a/plugins/modules/dtc/verify_tags.py b/plugins/modules/dtc/verify_tags.py new file mode 100644 index 000000000..edc0cc59a --- /dev/null +++ b/plugins/modules/dtc/verify_tags.py @@ -0,0 +1,58 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + + +DOCUMENTATION = """ +--- +module: verify_tags +short_description: Action plugin to verify embedded collection tags. +version_added: "0.3.0" +author: Mike Wiebe (@mikewiebe) +description: +- Action plugin to verify embedded collection tags. +- Used a dependency within the overall collection. +options: + all_tags: + description: + - All the tags supported in the collection natively. + required: true + type: dict + play_tags: + description: + - List of current play tags. + required: true + type: list +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Verify User Tags + cisco.nac_dc_vxlan.dtc.verify_tags: + all_tags: "{{ nac_tags.all }}" + play_tags: "{{ ansible_run_tags }}" + tags: "{{ ansible_run_tags }}" + +""" diff --git a/plugins/modules/dtc/vpc_pair_check.py b/plugins/modules/dtc/vpc_pair_check.py new file mode 100644 index 000000000..1c80f7530 --- /dev/null +++ b/plugins/modules/dtc/vpc_pair_check.py @@ -0,0 +1,63 @@ +# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# SPDX-License-Identifier: MIT + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + + +DOCUMENTATION = """ +--- +module: nac_dc_validate +short_description: Prepare action plugin to validate the data model against the schema and return the rendered data model. +version_added: "0.1.0" +author: Rameez Rahim M (@rrahimm) +description: +- Prepare action plugin to validate the data model against the schema and return the rendered data model. +options: + schema: + description: + - The path to the schema file. + required: false + type: str + mdata: + description: + - The path to the model data dir. + required: true + type: dict + rules: + description: + - The path to the rules dir. + required: false + type: str +""" + +EXAMPLES = """ + +# Perform Required Syntax and Semantic Model Validation and Return the Model Data + +- name: Perform Required Syntax and Semantic Model Validation + cisco.nac_dc_vxlan.common.nac_dc_validate: + schema: "{{ schema_path }}" + mdata: "{{ data_path }}" + rules: "{{ rules_path }}" + register: model_data + +""" diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 46dd157d9..d9927ea3f 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -13,7 +13,7 @@ plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignor plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/modules/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/modules/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/modules/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/nac_dc_validate.py import-3.10!skip diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 46dd157d9..d9927ea3f 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -13,7 +13,7 @@ plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignor plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/modules/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/modules/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/modules/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/nac_dc_validate.py import-3.10!skip diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 46dd157d9..d9927ea3f 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -13,7 +13,7 @@ plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignor plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/modules/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/modules/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/modules/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/nac_dc_validate.py import-3.10!skip From d83d27b5b76cb0a1778fa9e7d53a2ba0ffd64307 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 08:31:56 -0400 Subject: [PATCH 15/20] update ignores --- tests/sanity/ignore-2.14.txt | 6 +++--- tests/sanity/ignore-2.15.txt | 6 +++--- tests/sanity/ignore-2.16.txt | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index d9927ea3f..605da96c2 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -13,7 +13,7 @@ plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignor plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/modules/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/modules/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/modules/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/modules/dtc/verify_tags.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/dtc/diff_model_changes.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/dtc/update_switch_hostname_policy.py validate-modules:missing-gplv3-license # ignore license check plugins/action/common/nac_dc_validate.py import-3.10!skip diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index d9927ea3f..605da96c2 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -13,7 +13,7 @@ plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignor plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/modules/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/modules/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/modules/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/modules/dtc/verify_tags.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/dtc/diff_model_changes.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/dtc/update_switch_hostname_policy.py validate-modules:missing-gplv3-license # ignore license check plugins/action/common/nac_dc_validate.py import-3.10!skip diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index d9927ea3f..605da96c2 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -13,7 +13,7 @@ plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignor plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/modules/dtc/verify_tags.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/modules/dtc/diff_model_changes.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/modules/dtc/update_switch_hostname_policy.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/modules/dtc/verify_tags.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/dtc/diff_model_changes.py validate-modules:missing-gplv3-license # ignore license check +plugins/modules/dtc/update_switch_hostname_policy.py validate-modules:missing-gplv3-license # ignore license check plugins/action/common/nac_dc_validate.py import-3.10!skip From 15bf1f902aa7e37e99e7f60b08af811e09cc0200 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 08:38:46 -0400 Subject: [PATCH 16/20] fix issues with documentation --- plugins/modules/common/check_roles.py | 3 +- plugins/modules/common/get_credentials.py | 3 +- plugins/modules/dtc/add_device_check.py | 65 ------------------- .../dtc/update_switch_hostname_policy.py | 3 +- plugins/modules/dtc/verify_tags.py | 1 + plugins/modules/dtc/vpc_pair_check.py | 63 ------------------ 6 files changed, 7 insertions(+), 131 deletions(-) delete mode 100644 plugins/modules/dtc/add_device_check.py delete mode 100644 plugins/modules/dtc/vpc_pair_check.py diff --git a/plugins/modules/common/check_roles.py b/plugins/modules/common/check_roles.py index 689b3de14..7bac06014 100644 --- a/plugins/modules/common/check_roles.py +++ b/plugins/modules/common/check_roles.py @@ -36,7 +36,8 @@ description: - List of roles. required: true - type: str + type: list + elements: str """ EXAMPLES = """ diff --git a/plugins/modules/common/get_credentials.py b/plugins/modules/common/get_credentials.py index a00e74b4c..da3406319 100644 --- a/plugins/modules/common/get_credentials.py +++ b/plugins/modules/common/get_credentials.py @@ -36,7 +36,8 @@ description: - Inventory list. required: true - type: str + type: list + elements: str """ EXAMPLES = """ diff --git a/plugins/modules/dtc/add_device_check.py b/plugins/modules/dtc/add_device_check.py deleted file mode 100644 index 75c876854..000000000 --- a/plugins/modules/dtc/add_device_check.py +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function -__metaclass__ = type - - -DOCUMENTATION = """ ---- -module: nac_dc_validate -short_description: Prepare action plugin to validate the data model against the schema and return the rendered data model. -version_added: "0.1.0" -author: - - Mike Wiebe (@mikewiebe) - - Matt Tarkington (@mtarking) -description: -- Prepare action plugin to validate the data model against the schema and return the rendered data model. -options: - schema: - description: - - The path to the schema file. - required: false - type: str - mdata: - description: - - The path to the model data dir. - required: true - type: dict - rules: - description: - - The path to the rules dir. - required: false - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.nac_dc_validate: - schema: "{{ schema_path }}" - mdata: "{{ data_path }}" - rules: "{{ rules_path }}" - register: model_data - -""" diff --git a/plugins/modules/dtc/update_switch_hostname_policy.py b/plugins/modules/dtc/update_switch_hostname_policy.py index 8457c82ee..f2e21279d 100644 --- a/plugins/modules/dtc/update_switch_hostname_policy.py +++ b/plugins/modules/dtc/update_switch_hostname_policy.py @@ -42,6 +42,7 @@ - List of switch serial numbers NDFC is managing. required: true type: list + elements: str template_name: description: - NDFC template name. @@ -51,7 +52,7 @@ EXAMPLES = """ -# Parses, builds, and returns an updated policy payload for updating NDFC switch hostnames based on the data model. +# Parses, builds, and returns an updated policy payload for updating NDFC switch hostnames based on the data model. - name: Build Switch Hostname Policy Payload from Data Model Update cisco.nac_dc_vxlan.dtc.update_switch_hostname_policy: diff --git a/plugins/modules/dtc/verify_tags.py b/plugins/modules/dtc/verify_tags.py index edc0cc59a..9712dde22 100644 --- a/plugins/modules/dtc/verify_tags.py +++ b/plugins/modules/dtc/verify_tags.py @@ -43,6 +43,7 @@ - List of current play tags. required: true type: list + elements: str """ EXAMPLES = """ diff --git a/plugins/modules/dtc/vpc_pair_check.py b/plugins/modules/dtc/vpc_pair_check.py deleted file mode 100644 index 1c80f7530..000000000 --- a/plugins/modules/dtc/vpc_pair_check.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# SPDX-License-Identifier: MIT - -from __future__ import absolute_import, division, print_function -__metaclass__ = type - - -DOCUMENTATION = """ ---- -module: nac_dc_validate -short_description: Prepare action plugin to validate the data model against the schema and return the rendered data model. -version_added: "0.1.0" -author: Rameez Rahim M (@rrahimm) -description: -- Prepare action plugin to validate the data model against the schema and return the rendered data model. -options: - schema: - description: - - The path to the schema file. - required: false - type: str - mdata: - description: - - The path to the model data dir. - required: true - type: dict - rules: - description: - - The path to the rules dir. - required: false - type: str -""" - -EXAMPLES = """ - -# Perform Required Syntax and Semantic Model Validation and Return the Model Data - -- name: Perform Required Syntax and Semantic Model Validation - cisco.nac_dc_vxlan.common.nac_dc_validate: - schema: "{{ schema_path }}" - mdata: "{{ data_path }}" - rules: "{{ rules_path }}" - register: model_data - -""" From e0ca6669476021372f1e2dda0a29f5785e986ec8 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 08:48:35 -0400 Subject: [PATCH 17/20] test update to ignore files --- tests/sanity/ignore-2.14.txt | 2 -- tests/sanity/ignore-2.15.txt | 2 -- tests/sanity/ignore-2.16.txt | 2 -- 3 files changed, 6 deletions(-) diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 605da96c2..7f6fbc19a 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -11,8 +11,6 @@ plugins/modules/common/check_roles.py validate-modules:missing-gplv3-license # i plugins/modules/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/modules/dtc/verify_tags.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/dtc/diff_model_changes.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/dtc/update_switch_hostname_policy.py validate-modules:missing-gplv3-license # ignore license check diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 605da96c2..7f6fbc19a 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -11,8 +11,6 @@ plugins/modules/common/check_roles.py validate-modules:missing-gplv3-license # i plugins/modules/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/modules/dtc/verify_tags.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/dtc/diff_model_changes.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/dtc/update_switch_hostname_policy.py validate-modules:missing-gplv3-license # ignore license check diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 605da96c2..7f6fbc19a 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -11,8 +11,6 @@ plugins/modules/common/check_roles.py validate-modules:missing-gplv3-license # i plugins/modules/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check -plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/modules/dtc/verify_tags.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/dtc/diff_model_changes.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/dtc/update_switch_hostname_policy.py validate-modules:missing-gplv3-license # ignore license check From 7a16be55706d43623b3425f4dfb4c8218815a00b Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Wed, 9 Oct 2024 08:53:37 -0400 Subject: [PATCH 18/20] test update to ignore files --- tests/sanity/ignore-2.14.txt | 2 ++ tests/sanity/ignore-2.15.txt | 2 ++ tests/sanity/ignore-2.16.txt | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 7f6fbc19a..605da96c2 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -11,6 +11,8 @@ plugins/modules/common/check_roles.py validate-modules:missing-gplv3-license # i plugins/modules/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check +plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/modules/dtc/verify_tags.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/dtc/diff_model_changes.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/dtc/update_switch_hostname_policy.py validate-modules:missing-gplv3-license # ignore license check diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 7f6fbc19a..605da96c2 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -11,6 +11,8 @@ plugins/modules/common/check_roles.py validate-modules:missing-gplv3-license # i plugins/modules/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check +plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/modules/dtc/verify_tags.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/dtc/diff_model_changes.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/dtc/update_switch_hostname_policy.py validate-modules:missing-gplv3-license # ignore license check diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 7f6fbc19a..605da96c2 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -11,6 +11,8 @@ plugins/modules/common/check_roles.py validate-modules:missing-gplv3-license # i plugins/modules/common/get_credentials.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/run_map.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/common/read_run_map.py validate-modules:missing-gplv3-license # ignore license check +plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation +plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/modules/dtc/verify_tags.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/dtc/diff_model_changes.py validate-modules:missing-gplv3-license # ignore license check plugins/modules/dtc/update_switch_hostname_policy.py validate-modules:missing-gplv3-license # ignore license check From 4a5dfbc780b8ceabf5353e9017b1056049b5fa9d Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Thu, 7 Nov 2024 08:32:29 -0500 Subject: [PATCH 19/20] update nac_dc_validate as update in another PR --- plugins/action/common/nac_dc_validate.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/plugins/action/common/nac_dc_validate.py b/plugins/action/common/nac_dc_validate.py index d8ec73aef..ade0a690d 100644 --- a/plugins/action/common/nac_dc_validate.py +++ b/plugins/action/common/nac_dc_validate.py @@ -26,17 +26,10 @@ from ansible.utils.display import Display from ansible.plugins.action import ActionBase -from ansible.errors import AnsibleError - -try: - import iac_validate.validator - from iac_validate.yaml import load_yaml_files - from iac_validate.cli.options import DEFAULT_SCHEMA -except ImportError as imp_exc: - IAC_VALIDATE_IMPORT_ERROR = imp_exc -else: - IAC_VALIDATE_IMPORT_ERROR = None +import iac_validate.validator +from iac_validate.yaml import load_yaml_files +from iac_validate.cli.options import DEFAULT_SCHEMA import os display = Display() @@ -50,9 +43,6 @@ def run(self, tmp=None, task_vars=None): results['msg'] = None results['data'] = {} - if IAC_VALIDATE_IMPORT_ERROR: - raise AnsibleError('iac-validate must be installed to use this plugin') from IAC_VALIDATE_IMPORT_ERROR - schema = self._task.args.get('schema') rules = self._task.args.get('rules') mdata = self._task.args.get('mdata') From 83ac9150a8446a7fb14973730b41b50231dd9d0c Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Thu, 7 Nov 2024 08:51:58 -0500 Subject: [PATCH 20/20] remove duplicate entries --- tests/sanity/ignore-2.14.txt | 3 --- tests/sanity/ignore-2.15.txt | 3 --- tests/sanity/ignore-2.16.txt | 3 --- 3 files changed, 9 deletions(-) diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 4066d2ca9..9720070ec 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -17,11 +17,8 @@ plugins/modules/dtc/update_switch_hostname_policy.py validate-modules:missing-gp plugins/action/common/merge_defaults.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/get_poap_data.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/nac_dc_validate.py import-3.10!skip -plugins/action/test/inventory.py import-3.10!skip plugins/action/common/run_map.py import-3.10!skip plugins/action/common/read_run_map.py import-3.10!skip plugins/action/dtc/diff_model_changes.py import-3.10!skip diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 4066d2ca9..9720070ec 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -17,11 +17,8 @@ plugins/modules/dtc/update_switch_hostname_policy.py validate-modules:missing-gp plugins/action/common/merge_defaults.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/get_poap_data.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/nac_dc_validate.py import-3.10!skip -plugins/action/test/inventory.py import-3.10!skip plugins/action/common/run_map.py import-3.10!skip plugins/action/common/read_run_map.py import-3.10!skip plugins/action/dtc/diff_model_changes.py import-3.10!skip diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 4066d2ca9..9720070ec 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -17,11 +17,8 @@ plugins/modules/dtc/update_switch_hostname_policy.py validate-modules:missing-gp plugins/action/common/merge_defaults.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/add_device_check.py action-plugin-docs # action plugin has no matching module to provide documentation -plugins/action/dtc/vpc_pair_check.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/dtc/get_poap_data.py action-plugin-docs # action plugin has no matching module to provide documentation plugins/action/common/nac_dc_validate.py import-3.10!skip -plugins/action/test/inventory.py import-3.10!skip plugins/action/common/run_map.py import-3.10!skip plugins/action/common/read_run_map.py import-3.10!skip plugins/action/dtc/diff_model_changes.py import-3.10!skip