Skip to content

Commit

Permalink
Merge pull request #210 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
application of the changes made in pull request #207
  • Loading branch information
JosePabloOcampo1212 authored Dec 4, 2024
2 parents 1aa90c4 + 089bc04 commit 31341c6
Show file tree
Hide file tree
Showing 8 changed files with 221 additions and 185 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/sanity_tests_devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@ jobs:
lintable_files=""
for file in $changed_files; do
# Check if the file belongs to the plugins/modules or playbooks directory
if [[ $file == plugins/modules/* || $file == playbooks/* ]]; then
if [[ $file == playbooks/* ]]; then
lintable_files="$lintable_files $file"
fi
done
echo "Lintable Files: $lintable_files"
if [ -n "$lintable_files" ]; then
echo "Running yamllint test for files: $lintable_files"
yamllint -c .yamllint.yml $lintable_files
echo "Yamllint tests completed successfully."
else
echo "No relevant files to lint."
fi
Expand Down
7 changes: 6 additions & 1 deletion .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@ extends: default
ignore:
- tests
- changelogs/changelog.yaml
# - playbooks
- plugins

level: warning

rules:
line-length:
max: 160
level: warning

indentation:

Check warning on line 15 in .yamllint.yml

View workflow job for this annotation

GitHub Actions / Sanity (Ⓐstable-2.15)

15:15 [trailing-spaces] trailing spaces

Check warning on line 15 in .yamllint.yml

View workflow job for this annotation

GitHub Actions / Sanity (Ⓐstable-2.16)

15:15 [trailing-spaces] trailing spaces

Check warning on line 15 in .yamllint.yml

View workflow job for this annotation

GitHub Actions / Sanity (Ⓐstable-2.17)

15:15 [trailing-spaces] trailing spaces

Check warning on line 15 in .yamllint.yml

View workflow job for this annotation

GitHub Actions / Sanity (Ⓐdevel)

15:15 [trailing-spaces] trailing spaces
level: warning

trailing-spaces:
level: warning

new-line-at-end-of-file:
level: warning

key-duplicates:
level: warning
6 changes: 6 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1106,3 +1106,9 @@ releases:
- Changes in sda_extranet_policy_workflow_manager
- Changes in site_workflow_manager
- Modifications due to documentation errors
6.25.1:
release_date: "2024-12-04"
changes:
release_summary: application of unapplied changes.
minor_changes:
- application of the changes made in pull request 207
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: cisco
name: dnac
version: 6.25.0
version: 6.25.1
readme: README.md
authors:
- Rafael Campos <[email protected]>
Expand Down
1 change: 0 additions & 1 deletion playbooks/sda_extranet_policies_workflow_manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
provider_virtual_network: "VN_1"
subscriber_virtual_networks: ["VN_2", "VN_4"]


- name: Update existing Extranet Policy with Fabric Site(s) specified
cisco.dnac.network_compliance_workflow_manager:
<<: *dnac_login
Expand Down
94 changes: 50 additions & 44 deletions plugins/modules/network_settings_workflow_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Copyright (c) 2024, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)


"""Ansible module to perform operations on global pool, reserve pool and network in Cisco Catalyst Center."""
from __future__ import absolute_import, division, print_function

Expand All @@ -14,38 +15,38 @@
module: network_settings_workflow_manager
short_description: Resource module for IP Address pools and network functions
description:
- Manage operations on Global Pool, Reserve Pool, Network resources.
- API to create/update/delete global pool.
- API to reserve/update/delete an ip subpool from the global pool.
- API to update network settings for DHCP, Syslog, SNMP, NTP, Network AAA, Client and Endpoint AAA,
- Manage operations on Global Pool, Reserve Pool, Network resources.
- API to create/update/delete global pool.
- API to reserve/update/delete an ip subpool from the global pool.
- API to update network settings for DHCP, Syslog, SNMP, NTP, Network AAA, Client and Endpoint AAA,
and/or DNS center server settings.
version_added: '6.6.0'
extends_documentation_fragment:
- cisco.dnac.workflow_manager_params
- cisco.dnac.workflow_manager_params
author: Muthu Rakesh (@MUTHU-RAKESH-27)
Madhan Sankaranarayanan (@madhansansel)
Megha Kandari (@kandarimegha)
options:
config_verify:
description: Set to True to verify the Cisco Catalyst Center after applying the playbook config.
type: bool
default: False
state:
description: The state of Cisco Catalyst Center after module completion.
type: str
choices: [ merged, deleted ]
default: merged
config:
description:
config_verify:
description: Set to True to verify the Cisco Catalyst Center after applying the playbook config.
type: bool
default: False
state:
description: The state of Cisco Catalyst Center after module completion.
type: str
choices: [merged, deleted]
default: merged
config:
description:
- List of details of global pool, reserved pool, network being managed.
type: list
elements: dict
required: true
suboptions:
global_pool_details:
description: Manages IPv4 and IPv6 IP pools in the global level.
type: dict
suboptions:
type: list
elements: dict
required: true
suboptions:
global_pool_details:
description: Manages IPv4 and IPv6 IP pools in the global level.
type: dict
suboptions:
settings:
description: Global Pool's settings.
type: dict
Expand All @@ -57,10 +58,10 @@
suboptions:
name:
description:
- Specifies the name assigned to the Global IP Pool.
- Required for the operations in the Global IP Pool.
- Length should be less than or equal to 100.
- Only letters, numbers and -_./ characters are allowed.
- Specifies the name assigned to the Global IP Pool.
- Required for the operations in the Global IP Pool.
- Length should be less than or equal to 100.
- Only letters, numbers and -_./ characters are allowed.
type: str
pool_type:
description: >
Expand Down Expand Up @@ -100,7 +101,7 @@
exclusively when you need to update the global pool's name.
type: str
reserve_pool_details:
reserve_pool_details:
description: Reserved IP subpool details from the global pool.
type: dict
suboptions:
Expand All @@ -111,10 +112,10 @@
type: str
name:
description:
- Name of the reserve IP subpool.
- Required for the operations in the Reserve IP Pool.
- Length should be less than or equal to 100.
- Only letters, numbers and -_./ characters are allowed.
- Name of the reserve IP subpool.
- Required for the operations in the Reserve IP Pool.
- Length should be less than or equal to 100.
- Only letters, numbers and -_./ characters are allowed.
type: str
pool_type:
description: Type of the reserve ip sub pool.
Expand All @@ -139,13 +140,13 @@
type: bool
ipv4_global_pool:
description:
- IP v4 Global pool address with cidr, example 175.175.0.0/16.
- If both 'ipv6_global_pool' and 'ipv4_global_pool_name' are provided, the 'ipv4_global_pool' will be given priority.
- IP v4 Global pool address with cidr, example 175.175.0.0/16.
- If both 'ipv6_global_pool' and 'ipv4_global_pool_name' are provided, the 'ipv4_global_pool' will be given priority.
type: str
ipv4_global_pool_name:
description:
- Specifies the name to be associated with the IPv4 Global IP Pool.
- If both 'ipv4_global_pool' and 'ipv4_global_pool_name' are provided, the 'ipv4_global_pool' will be given priority.
- Specifies the name to be associated with the IPv4 Global IP Pool.
- If both 'ipv4_global_pool' and 'ipv4_global_pool_name' are provided, the 'ipv4_global_pool' will be given priority.
type: str
version_added: 6.14.0
ipv4_subnet:
Expand Down Expand Up @@ -191,14 +192,14 @@
type: str
ipv6_global_pool:
description:
- The ipv6_global_pool is a required when the ipv6_address_space is set to true.
- It specifies the global IPv6 address pool using CIDR notation, such as "2001:db8:85a3::/64".
- In cases where both ipv6_global_pool and ipv6_global_pool_name are specified, ipv6_global_pool will take precedence.
- The ipv6_global_pool is a required when the ipv6_address_space is set to true.
- It specifies the global IPv6 address pool using CIDR notation, such as "2001:db8:85a3::/64".
- In cases where both ipv6_global_pool and ipv6_global_pool_name are specified, ipv6_global_pool will take precedence.
type: str
ipv6_global_pool_name:
description:
- Specifies the name assigned to the Ip v6 Global IP Pool.
- If both 'ipv6_global_pool' and 'ipv6_global_pool_name' are provided, the 'ipv6_global_pool' will be given priority.
- Specifies the name assigned to the Ip v6 Global IP Pool.
- If both 'ipv6_global_pool' and 'ipv6_global_pool_name' are provided, the 'ipv6_global_pool' will be given priority.
type: str
version_added: 6.14.0
ipv6_subnet:
Expand Down Expand Up @@ -226,7 +227,7 @@
Allows devices on IPv6 networks to self-configure their
IP addresses autonomously, eliminating the need for manual setup.
type: bool
network_management_details:
network_management_details:
description: Set default network settings for the site
type: list
elements: dict
Expand Down Expand Up @@ -2197,7 +2198,12 @@ def get_want_global_pool(self, global_ippool):
"gateway": pool_details.get("gateway"),
"type": pool_details.get("pool_type"),
}
ip_address_space = pool_details.get("ip_address_space")
ip_address_space = pool_details.get("ip_address_space", "").upper()
if ip_address_space == "IPV4":
ip_address_space = "IPv4"
elif ip_address_space == "IPV6":
ip_address_space = "IPv6"

if not ip_address_space:
self.msg = "Missing required parameter 'ip_address_space' under global_pool_details."
self.status = "failed"
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/sda_extranet_policies_workflow_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def get_fabric_ids_list(self, site_details):
the 'fabric_id' from each value, and appends it to a list. The resulting list of fabric IDs
is then returned.
"""
# Initialize an empty list to store fabric IDs
# Initialize an empty list to store the fabric IDs
fabric_ids_list = []

# Iterate over each site's information in the site details
Expand Down
Loading

0 comments on commit 31341c6

Please sign in to comment.