Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Global Pool with ip_address_space is 'ipv4' or 'IPV4' fail #29

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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."""
madhansansel marked this conversation as resolved.
Show resolved Hide resolved
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
Loading