diff --git a/plugins/modules/accesspoint_workflow_manager.py b/plugins/modules/accesspoint_workflow_manager.py index 11b24c9d9a..f83e8772d9 100644 --- a/plugins/modules/accesspoint_workflow_manager.py +++ b/plugins/modules/accesspoint_workflow_manager.py @@ -30,13 +30,13 @@ options: config_verify: - description: Set to True to verify the Cisco Catalyst Center configuration after applying the playbook config. + description: Set to true to verify the Cisco Catalyst Center configuration after applying the playbook config. type: bool - default: False + default: false state: description: The desired state of the device replacement workflow. type: str - choices: [ "merged", "deleted" ] + choices: ["merged", "deleted"] default: merged dnac_api_task_timeout: description: The number of times to retry resynchronization. @@ -54,7 +54,7 @@ description: List of details of AP being managed. type: list elements: dict - required: True + required: true suboptions: mac_address: description: | @@ -64,7 +64,7 @@ - hostname - management_ip_address type: str - required: True + required: true hostname: description: | The Host Name used to identify the device. If provided, it cannot be modified. @@ -73,7 +73,7 @@ - hostname - management_ip_address type: str - required: True + required: true management_ip_address: description: | The Management IP Address used to identify the device. If provided, it cannot be modified. @@ -82,13 +82,13 @@ - hostname - management_ip_address type: str - required: True + required: true rf_profile: description: | Specifies the Radio Frequency (RF) profile name for the Access Point. It can be one of the standard profiles "HIGH", "LOW", "TYPICAL", or a custom profile that has been created. For example, "HIGH". type: str - required: False + required: false site: description: Current site details where the Access Point is located. type: dict @@ -96,285 +96,285 @@ floor: description: Floor details of the current site. type: dict - required: False + required: false suboptions: name: description: Name of the floor. For example, "FLOOR1". type: str - required: False + required: false parent_name: description: Parent name of the floor in the site hierarchy. For example, "Global/USA/New York/BLDNYC". type: str - required: False + required: false ap_name: description: Current AP name that needs to be changed along with the new AP name. For example, "Test2". type: str - required: False + required: false admin_status: description: Status of the AP configuration. Accepts "Enabled" or "Disabled". For example, "Enabled". type: str - required: False + required: false led_status: description: State of the AP's LED. Accepts "Enabled" or "Disabled". For example, "Enabled". type: str - required: False + required: false led_brightness_level: description: Brightness level of the AP's LED. Accepts values from 1 to 8. For example, 3. type: int - required: False + required: false ap_mode: description: | Defines the mode of operation for the Access Point (AP). Possible values include "Local", "Monitor", "Sniffer", or "Bridge". For example, "Local". type: str - required: False + required: false location: description: Location name of the AP. Provide this data if a change is required. For example, "Bangalore". type: str - required: False + required: false is_assigned_site_as_location: description: | Configures whether the access point location is automatically set to the site assigned to the access point. Accepts "Enabled" or "Disabled". If set to "Enabled", no additional location configuration is required. type: str - required: False + required: false failover_priority: description: Priority order for failover in AP configuration. Accepts "Low", "Medium", "High", or "Critical". type: str - required: False + required: false clean_air_si_2.4ghz: description: | Clean Air Spectrum Intelligence (SI) feature status for the 2.4GHz band. Indicates whether. For example, "Enabled". Clean Air Spectrum Intelligence is enabled or disabled. type: str - required: False + required: false clean_air_si_5ghz: description: | Clean Air Spectrum Intelligence (SI) feature status for the 5GHz band. Indicates whether. For example, "Enabled". Clean Air Spectrum Intelligence is enabled or disabled. type: str - required: False + required: false clean_air_si_6ghz: description: | Clean Air Spectrum Intelligence (SI) feature status for the 6GHz band. Indicates whether. For example, "Enabled". Clean Air Spectrum Intelligence is enabled or disabled. type: str - required: False + required: false primary_controller_name: description: | Name or identifier of the primary wireless LAN controller (WLC) managing the Access Point (AP). For example, "SJ-EWLC-1". type: str - required: False + required: false primary_ip_address: description: IP address of the primary wireless LAN controller (WLC) managing the Access Point (AP). type: dict - required: False + required: false suboptions: address: description: IP address of the primary wireless LAN controller. For example, "10.0.0.3". type: str - required: False + required: true secondary_controller_name: description: | Name or identifier of the secondary wireless LAN controller (WLC) managing the Access Point (AP). To modify only the primary controller, set the secondary and tertiary controller names to "Inherit from site / Clear". type: str - required: False + required: false secondary_ip_address: description: IP address of the secondary wireless LAN controller (WLC) managing the Access Point (AP). type: dict - required: False + required: false suboptions: address: description: IP address of the primary wireless LAN controller. For example, "10.0.0.3". type: str - required: False + required: true tertiary_controller_name: description: | Name or identifier of the tertiary wireless LAN controller (WLC) managing the Access Point (AP). To modify only the primary controller, set the secondary and tertiary controller names to "Inherit from site / Clear". type: str - required: False + required: false tertiary_ip_address: description: IP address of the tertiary wireless LAN controller (WLC) managing the Access Point (AP). type: dict - required: False + required: false suboptions: address: description: IP address of the primary wireless LAN controller. For example, "10.0.0.2". type: str - required: False + required: true 2.4ghz_radio: description: Configuration options for the 2.4GHz radio interface. type: dict - required: False + required: false suboptions: admin_status: description: Administrative status for the 2.4GHz radio interface. For example, "Enabled". type: str - required: False + required: false antenna_name: description: Name or type of antenna used for the 2.4GHz radio interface. For example, "other". type: str - required: False + required: false antenna_gain: description: | Specifies the antenna gain value in decibels (dB) for the 2.4GHz radio interface, valid values range from 0 to 40. For example, 10. type: int - required: False + required: false radio_role_assignment: description: Role assignment mode for the 2.4GHz radio interface. Accepts "Auto", "Client-serving", or "Monitor". For example, Auto. type: str - required: False + required: false cable_loss: description: | Cable loss in dB for the 2.4GHz radio interface. Valid values are from 0 to 40. This value must be less than the antenna gain. For example, 2. type: int - required: False + required: false antenna_cable_name: description: Name or type of antenna cable used for the 2.4GHz radio interface. For example, "other". type: str - required: False + required: false channel_assignment_mode: description: Mode of channel assignment for the 2.4GHz radio interface. Accepts "Global" or "Custom". For example, "Custom". type: str - required: False + required: false channel_number: description: Custom channel number configured for the 2.4GHz radio interface. For example, 6. type: int - required: False + required: false power_assignment_mode: description: Mode of power assignment for the 2.4GHz radio interface. Accepts "Global" or "Custom". For example, "Custom". type: str - required: False + required: false power_level: description: Custom power level configured for the 2.4GHz radio interface. For example, 3. type: int - required: False + required: false 5ghz_radio: description: Configuration options for the 5GHz radio interface. type: dict - required: False + required: false suboptions: admin_status: description: Administrative status for the 5GHz radio interface. For example, "Enabled". type: str - required: False + required: false antenna_name: description: Name or type of antenna used for the 5GHz radio interface. For example, "other". type: str - required: False + required: false antenna_gain: description: | Antenna gain value in decibels (dB) for the 5GHz radio interface, valid values range from 0 to 40. For example, 5. type: int - required: False + required: false radio_role_assignment: description: | Role assignment mode for the 5GHz radio interface. Accepts "Auto", "Client-serving", or "Monitor". For example, "Auto". This field not required for xor series access point slot 1 type: str - required: False + required: false cable_loss: description: | Cable loss in dB for the 5GHz radio interface. Valid values are from 0 to 40. This value must be less than the antenna gain. For example, 3. type: int - required: False + required: false antenna_cable_name: description: Name or type of antenna cable used for the 5GHz radio interface. For example, "other". type: str - required: False + required: false channel_assignment_mode: description: Mode of channel assignment for the 5GHz radio interface. Accepts "Global" or "Custom". For example, "Custom". type: str - required: False + required: false channel_number: description: Custom channel number configured for the 5GHz radio interface. For example, 36. type: int - required: False + required: false power_assignment_mode: description: Mode of power assignment for the 5GHz radio interface. Accepts "Global" or "Custom". For example, "Custom". type: str - required: False + required: false power_level: description: Custom power level configured for the 5GHz radio interface. For example, 3. type: int - required: False + required: false 6ghz_radio: description: Configuration options for the 6GHz radio interface. type: dict - required: False + required: false suboptions: admin_status: description: Administrative status for the 6GHz radio interface. For example, "Enabled". type: str - required: False + required: false antenna_name: description: Name or type of antenna used for the 6GHz radio interface. For example, "other". type: str - required: False + required: false antenna_gain: description: | Antenna gain value in decibels (dB) for the 6GHz radio interface, valid values range from 0 to 40. For example, 30. type: int - required: False + required: false radio_role_assignment: description: Role assignment mode for the 6GHz radio interface. Accepts "Auto", "Client-serving", or "Monitor". type: str - required: False + required: false cable_loss: description: | Cable loss in dB for the 6GHz radio interface. Valid values are from 0 to 40. This value must be less than the antenna gain. For example, 10. type: int - required: False + required: false antenna_cable_name: description: Name or type of antenna cable used for the 6GHz radio interface. For example, "other". type: str - required: False + required: false channel_assignment_mode: description: Mode of channel assignment for the 6GHz radio interface. Accepts "Global" or "Custom". For example, "Custom". type: str - required: False + required: false channel_number: description: Custom channel number configured for the 6GHz radio interface. For example, 6. type: int - required: False + required: false power_assignment_mode: description: Mode of power assignment for the 6GHz radio interface. Accepts "Global" or "Custom". For example, "Custom". type: str - required: False + required: false power_level: description: Custom power level configured for the 6GHz radio interface. For example, 3. type: int - required: False + required: false xor_radio: description: Configuration options for the XOR radio interface. type: dict - required: False + required: false suboptions: admin_status: description: Administrative status for the XOR radio interface. For example, "Enabled". type: str - required: False + required: false antenna_name: description: Name or type of antenna used for the XOR radio interface. For example, "other". type: str - required: False + required: false antenna_gain: description: | Antenna gain value in decibels (dB) for the XOR radio interface, valid values range from 0 to 40. For example, 14. type: int - required: False + required: false radio_role_assignment: description: | Role assignment mode for the XOR radio interface. Accepts "Auto", "Client-serving", or "Monitor" @@ -382,23 +382,23 @@ Additionally, if the 5 GHz band is selected in the radio band, the power level cannot be modified. For example, "Auto". type: str - required: False + required: false radio_band: description: | Radio band should be enabled if the radio role assignment is set to "Client-serving" mode. Accepts "2.4 GHz" or "5 GHz" or "6 GHz". type: str - required: False + required: false cable_loss: description: | Cable loss in dB for the XOR radio interface. Valid values are from 0 to 40. This value must be less than the antenna gain. For example, 5. type: int - required: False + required: false antenna_cable_name: description: Name or type of antenna cable used for the XOR radio interface. For example, "other". type: str - required: False + required: false channel_assignment_mode: description: | Mode of channel assignment for the XOR radio interface. Accepts "Global" or "Custom". @@ -416,106 +416,106 @@ 221, 225, 229, 233. For example, "Custom". type: str - required: False + required: false channel_number: description: Custom channel number configured for the XOR radio interface. For example, 6. type: int - required: False + required: false channel_width: description: | Width of the channel configured for the XOR radio interface. Accepts values "20 MHz", "40 MHz", "80 MHz", "160 MHz" or "320 MHz". For example, 20 MHz. type: str - required: False + required: false power_assignment_mode: description: | Mode of power assignment for the XOR radio interface. Accepts "Global" or "Custom." In "Custom" mode, valid values range from 1 to 8. type: str - required: False + required: false power_level: description: Custom power level configured for the XOR radio interface. For example, 3. type: int - required: False + required: false tri_radio: description: Configuration options for the TRI radio interface. type: dict - required: False + required: false suboptions: admin_status: description: Administrative status for the TRI radio interface. For example, "Enabled". type: str - required: False + required: false antenna_name: description: Name or type of antenna used for the TRI radio interface. For example, "other". type: str - required: False + required: false antenna_gain: description: | Antenna gain value in decibels (dB) for the TRI radio interface, valid values range from 0 to 40. For example, 16. type: int - required: False + required: false radio_role_assignment: description: | Role assignment mode for the TRI radio interface. Accepts "Auto", "Client-serving", or "Monitor". If radio_role_assignment is "client-serving", then only power-level and channel-level can be changed. type: str - required: False + required: false cable_loss: description: | Cable loss in dB for the TRI radio interface. Valid values are from 0 to 40. This value must be less than the antenna gain. For example, 6. type: int - required: False + required: false antenna_cable_name: description: Name or type of antenna cable used for the TRI radio interface. For example, "other". type: str - required: False + required: false channel_assignment_mode: description: | Mode of channel assignment for the TRI radio interface. Accepts "Global" or "Custom". For Custom, it accepts values like 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165, 169, 173. (eg. Custom) type: str - required: False + required: false channel_number: description: Custom channel number configured for the TRI radio interface. For example, 6. type: int - required: False + required: false channel_width: description: | Width of the channel configured for the TRI radio interface. Accepts values "20 MHz", "40 MHz", "80 MHz", "160 MHz", or "320 MHz". . For example, 20 MHz. type: str - required: False + required: false power_assignment_mode: description: | Mode of power assignment for the TRI radio interface. Accepts "Global" or "Custom". In Custom, it accepts values 1 to 8. type: str - required: False + required: false power_level: description: Custom power level configured for the TRI radio interface. For example, 3. type: int - required: False + required: false dual_radio_mode: description: | Mode of operation configured for the TRI radio interface. Specifies how the access point (AP) manages its dual radio functionality. eg . Auto type: str - required: False + required: false ap_selected_fields: description: When enable the verify flag "config_verify" to see only the filter field of the AP details in the output. (eg. "id,hostname,family,type,mac_address,management_ip_address,ap_ethernet_mac_address") type: str - required: False + required: false ap_config_selected_fields: description: | When enable the verify flag "config_verify" to see only the filter field of the AP configuration in the output. (eg. "mac_address,eth_mac,ap_name,led_brightness_level,led_status,location,radioDTOs") type: str - required: False + required: false reboot_aps: description: | Reboot one or more access points (APs) identified by their MAC addresses, hostnames, or management IP addresses. @@ -587,7 +587,7 @@ which is used to identify the access points for bulk updated with AP Name to update access point. type: list elements: str - required: True + required: true suboptions: mac_address: description: | @@ -597,7 +597,7 @@ - hostname - management_ip_address type: str - required: True + required: true hostname: description: | The Host Name used to identify the device. If provided, it cannot be modified. @@ -606,7 +606,7 @@ - hostname - management_ip_address type: str - required: True + required: true management_ip_address: description: | The Management IP Address used to identify the device. If provided, it cannot be modified. @@ -615,282 +615,282 @@ - hostname - management_ip_address type: str - required: True + required: true ap_name: description: Current AP name that needs to be changed along with the new AP name. For example, "Test2". type: str - required: False + required: false common_fields_to_change: description: | Common fields to change AP is a dict which contains below data which need to update all listed access points. type: dict - required: True + required: true suboptions: admin_status: description: Status of the AP configuration. Accepts "Enabled" or "Disabled". For example, "Enabled". type: str - required: False + required: false led_status: description: State of the AP's LED. Accepts "Enabled" or "Disabled". For example, "Enabled". type: str - required: False + required: false led_brightness_level: description: Brightness level of the AP's LED. Accepts values from 1 to 8. For example, 3. type: int - required: False + required: false ap_mode: description: | Defines the mode of operation for the Access Point (AP). Possible values include "Local", "Monitor", "Sniffer", or "Bridge". For example, "Local". type: str - required: False + required: false location: description: Location name of the AP. Provide this data if a change is required. For example, "Bangalore". type: str - required: False + required: false is_assigned_site_as_location: description: | Configures whether the access point location is automatically set to the site assigned to the access point. Accepts "Enabled" or "Disabled". If set to "Enabled", no additional location configuration is required. type: str - required: False + required: false failover_priority: description: Priority order for failover in AP configuration. Accepts "Low", "Medium", "High", or "Critical". type: str - required: False + required: false clean_air_si_2.4ghz: description: | Clean Air Spectrum Intelligence (SI) feature status for the 2.4GHz band. Indicates whether. For example, "Enabled". Clean Air Spectrum Intelligence is enabled or disabled. type: str - required: False + required: false clean_air_si_5ghz: description: | Clean Air Spectrum Intelligence (SI) feature status for the 5GHz band. Indicates whether. For example, "Enabled". Clean Air Spectrum Intelligence is enabled or disabled. type: str - required: False + required: false clean_air_si_6ghz: description: | Clean Air Spectrum Intelligence (SI) feature status for the 6GHz band. Indicates whether. For example, "Enabled". Clean Air Spectrum Intelligence is enabled or disabled. type: str - required: False + required: false primary_controller_name: description: | Name or identifier of the primary wireless LAN controller (WLC) managing the Access Point (AP). For example, "SJ-EWLC-1". type: str - required: False + required: false primary_ip_address: description: IP address of the primary wireless LAN controller (WLC) managing the Access Point (AP). type: dict - required: False + required: false suboptions: address: description: IP address of the primary wireless LAN controller. For example, "10.0.0.3". type: str - required: False + required: false secondary_controller_name: description: | Name or identifier of the secondary wireless LAN controller (WLC) managing the Access Point (AP). To modify only the primary controller, set the secondary and tertiary controller names to "Inherit from site / Clear". type: str - required: False + required: false secondary_ip_address: description: IP address of the secondary wireless LAN controller (WLC) managing the Access Point (AP). type: dict - required: False + required: false suboptions: address: description: IP address of the primary wireless LAN controller. For example, "10.0.0.3". type: str - required: False + required: false tertiary_controller_name: description: | Name or identifier of the tertiary wireless LAN controller (WLC) managing the Access Point (AP). To modify only the primary controller, set the secondary and tertiary controller names to "Inherit from site / Clear". type: str - required: False + required: false tertiary_ip_address: description: IP address of the tertiary wireless LAN controller (WLC) managing the Access Point (AP). type: dict - required: False + required: false suboptions: address: description: IP address of the primary wireless LAN controller. For example, "10.0.0.2". type: str - required: False + required: false 2.4ghz_radio: description: Configuration options for the 2.4GHz radio interface. type: dict - required: False + required: false suboptions: admin_status: description: Administrative status for the 2.4GHz radio interface. For example, "Enabled". type: str - required: False + required: false antenna_name: description: Name or type of antenna used for the 2.4GHz radio interface. For example, "other". type: str - required: False + required: false antenna_gain: description: | Specifies the antenna gain value in decibels (dB) for the 2.4GHz radio interface, valid values range from 0 to 40. For example, 10. type: int - required: False + required: false radio_role_assignment: description: Role assignment mode for the 2.4GHz radio interface. Accepts "Auto", "Client-serving", or "Monitor". For example, Auto. type: str - required: False + required: false cable_loss: description: | Cable loss in dB for the 2.4GHz radio interface. Valid values are from 0 to 40. This value must be less than the antenna gain. For example, 2. type: int - required: False + required: false antenna_cable_name: description: Name or type of antenna cable used for the 2.4GHz radio interface. For example, "other". type: str - required: False + required: false channel_assignment_mode: description: Mode of channel assignment for the 2.4GHz radio interface. Accepts "Global" or "Custom". For example, "Custom". type: str - required: False + required: false channel_number: description: Custom channel number configured for the 2.4GHz radio interface. For example, 6. type: int - required: False + required: false power_assignment_mode: description: Mode of power assignment for the 2.4GHz radio interface. Accepts "Global" or "Custom". For example, "Custom". type: str - required: False + required: false power_level: description: Custom power level configured for the 2.4GHz radio interface. For example, 3. type: int - required: False + required: false 5ghz_radio: description: Configuration options for the 5GHz radio interface. type: dict - required: False + required: false suboptions: admin_status: description: Administrative status for the 5GHz radio interface. For example, "Enabled". type: str - required: False + required: false antenna_name: description: Name or type of antenna used for the 5GHz radio interface. For example, "other". type: str - required: False + required: false antenna_gain: description: | Antenna gain value in decibels (dB) for the 5GHz radio interface, valid values range from 0 to 40. For example, 5. type: int - required: False + required: false radio_role_assignment: description: | Role assignment mode for the 5GHz radio interface. Accepts "Auto", "Client-serving", or "Monitor". For example, "Auto". This field not required for xor series access point slot 1 type: str - required: False + required: false cable_loss: description: | Cable loss in dB for the 5GHz radio interface. Valid values are from 0 to 40. This value must be less than the antenna gain. For example, 3. type: int - required: False + required: false antenna_cable_name: description: Name or type of antenna cable used for the 5GHz radio interface. For example, "other". type: str - required: False + required: false channel_assignment_mode: description: Mode of channel assignment for the 5GHz radio interface. Accepts "Global" or "Custom". For example, "Custom". type: str - required: False + required: false channel_number: description: Custom channel number configured for the 5GHz radio interface. For example, 36. type: int - required: False + required: false power_assignment_mode: description: Mode of power assignment for the 5GHz radio interface. Accepts "Global" or "Custom". For example, "Custom". type: str - required: False + required: false power_level: description: Custom power level configured for the 5GHz radio interface. For example, 3. type: int - required: False + required: false 6ghz_radio: description: Configuration options for the 6GHz radio interface. type: dict - required: False + required: false suboptions: admin_status: description: Administrative status for the 6GHz radio interface. For example, "Enabled". type: str - required: False + required: false antenna_name: description: Name or type of antenna used for the 6GHz radio interface. For example, "other". type: str - required: False + required: false antenna_gain: description: | Antenna gain value in decibels (dB) for the 6GHz radio interface, valid values range from 0 to 40. For example, 30. type: int - required: False + required: false radio_role_assignment: description: Role assignment mode for the 6GHz radio interface. Accepts "Auto", "Client-serving", or "Monitor". type: str - required: False + required: false cable_loss: description: | Cable loss in dB for the 6GHz radio interface. Valid values are from 0 to 40. This value must be less than the antenna gain. For example, 10. type: int - required: False + required: false antenna_cable_name: description: Name or type of antenna cable used for the 6GHz radio interface. For example, "other". type: str - required: False + required: false channel_assignment_mode: description: Mode of channel assignment for the 6GHz radio interface. Accepts "Global" or "Custom". For example, "Custom". type: str - required: False + required: false channel_number: description: Custom channel number configured for the 6GHz radio interface. For example, 6. type: int - required: False + required: false power_assignment_mode: description: Mode of power assignment for the 6GHz radio interface. Accepts "Global" or "Custom". For example, "Custom". type: str - required: False + required: false power_level: description: Custom power level configured for the 6GHz radio interface. For example, 3. type: int - required: False + required: false xor_radio: description: Configuration options for the XOR radio interface. type: dict - required: False + required: false suboptions: admin_status: description: Administrative status for the XOR radio interface. For example, "Enabled". type: str - required: False + required: false antenna_name: description: Name or type of antenna used for the XOR radio interface. For example, "other". type: str - required: False + required: false antenna_gain: description: | Antenna gain value in decibels (dB) for the XOR radio interface, valid values range from 0 to 40. For example, 14. type: int - required: False + required: false radio_role_assignment: description: | Role assignment mode for the XOR radio interface. Accepts "Auto", "Client-serving", or "Monitor" @@ -898,23 +898,23 @@ Additionally, if the 5 GHz band is selected in the radio band, the power level cannot be modified. For example, "Auto". type: str - required: False + required: false radio_band: description: | Radio band should be enabled if the radio role assignment is set to "Client-serving" mode. Accepts "2.4 GHz" or "5 GHz" or "6 GHz". type: str - required: False + required: false cable_loss: description: | Cable loss in dB for the XOR radio interface. Valid values are from 0 to 40. This value must be less than the antenna gain. For example, 5. type: int - required: False + required: false antenna_cable_name: description: Name or type of antenna cable used for the XOR radio interface. For example, "other". type: str - required: False + required: false channel_assignment_mode: description: | Mode of channel assignment for the XOR radio interface. Accepts "Global" or "Custom". @@ -932,95 +932,95 @@ 221, 225, 229, 233. For example, "Custom". type: str - required: False + required: false channel_number: description: Custom channel number configured for the XOR radio interface. For example, 6. type: int - required: False + required: false channel_width: description: | Width of the channel configured for the XOR radio interface. Accepts values "20 MHz", "40 MHz", "80 MHz", "160 MHz" or "320 MHz". For example, 20 MHz. type: str - required: False + required: false power_assignment_mode: description: | Mode of power assignment for the XOR radio interface. Accepts "Global" or "Custom." In "Custom" mode, valid values range from 1 to 8. type: str - required: False + required: false power_level: description: Custom power level configured for the XOR radio interface. For example, 3. type: int - required: False + required: false tri_radio: description: Configuration options for the TRI radio interface. type: dict - required: False + required: false suboptions: admin_status: description: Administrative status for the TRI radio interface. For example, "Enabled". type: str - required: False + required: false antenna_name: description: Name or type of antenna used for the TRI radio interface. For example, "other". type: str - required: False + required: false antenna_gain: description: | Antenna gain value in decibels (dB) for the TRI radio interface, valid values range from 0 to 40. For example, 16. type: int - required: False + required: false radio_role_assignment: description: | Role assignment mode for the TRI radio interface. Accepts "Auto", "Client-serving", or "Monitor". If radio_role_assignment is "client-serving", then only power-level and channel-level can be changed. type: str - required: False + required: false cable_loss: description: | Cable loss in dB for the TRI radio interface. Valid values are from 0 to 40. This value must be less than the antenna gain. For example, 6. type: int - required: False + required: false antenna_cable_name: description: Name or type of antenna cable used for the TRI radio interface. For example, "other". type: str - required: False + required: false channel_assignment_mode: description: | Mode of channel assignment for the TRI radio interface. Accepts "Global" or "Custom". For Custom, it accepts values like 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165, 169, 173. (eg. Custom) type: str - required: False + required: false channel_number: description: Custom channel number configured for the TRI radio interface. For example, 6. type: int - required: False + required: false channel_width: description: | Width of the channel configured for the TRI radio interface. Accepts values "20 MHz", "40 MHz", "80 MHz", "160 MHz", or "320 MHz". . For example, 20 MHz. type: str - required: False + required: false power_assignment_mode: description: | Mode of power assignment for the TRI radio interface. Accepts "Global" or "Custom". In Custom, it accepts values 1 to 8. type: str - required: False + required: false power_level: description: Custom power level configured for the TRI radio interface. For example, 3. type: int - required: False + required: false dual_radio_mode: description: | Mode of operation configured for the TRI radio interface. Specifies how the access point (AP) manages its dual radio functionality. eg . Auto type: str - required: False + required: false requirements: - dnacentersdk >= 2.7.2 @@ -1073,9 +1073,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: False + config_verify: false state: merged config: - mac_address: 90:e9:5e:03:f3:40 @@ -1083,7 +1083,7 @@ admin_status: "Enabled" antenna_name: "AIR-ANT2513P4M-N-2.4GHz" radio_role_assignment: "Client-Serving" - powerlevel: 5 + power_level: 5 channel_number: 7 register: output_list @@ -1096,9 +1096,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: False + config_verify: false state: merged config: - mac_address: 90:e9:5e:03:f3:40 @@ -1116,9 +1116,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: False + config_verify: false state: merged config: - mac_address: 90:e9:5e:03:f3:40 @@ -1136,9 +1136,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: False + config_verify: false state: merged config: - mac_address: 90:e9:5e:03:f3:40 @@ -1156,9 +1156,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: False + config_verify: false state: merged config: - mac_address: 90:e9:5e:03:f3:40 @@ -1178,9 +1178,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: False + config_verify: false state: merged config: - mac_address: 90:e9:5e:03:f3:40 @@ -1188,7 +1188,7 @@ admin_status: "Enabled" antenna_name: "C-ANT9104-Single-D0-5GHz" channel_number: 52 - powerlevel: 5 + power_level: 5 channel_width: "40 MHz" register: output_list @@ -1201,9 +1201,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: False + config_verify: false state: merged config: - mac_address: 90:e9:5e:03:f3:40 @@ -1211,12 +1211,12 @@ admin_status: "Enabled" antenna_name: "C-ANT9103-2.4GHz" channel_number: 9 - powerlevel: 4 + power_level: 4 5ghz_radio: admin_status: "Enabled" antenna_name: "C-ANT9103-5GHz" channel_number: 40 - powerlevel: 3 + power_level: 3 channel_width: "20 MHz" register: output_list @@ -1229,9 +1229,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: True + config_verify: true state: merged config: - mac_address: 90:e9:5e:03:f3:40 @@ -1251,9 +1251,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: True + config_verify: true state: merged config: - mac_address: a4:88:73:d4:d6:60 @@ -1284,9 +1284,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: True + config_verify: true state: merged config: - mac_address: a4:88:73:d4:d6:60 @@ -1315,9 +1315,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: False + config_verify: false state: merged config: - mac_address: 90:e9:5e:03:f3:40 @@ -1338,13 +1338,13 @@ antenna_name: "C-ANT9104-2.4GHz" radio_role_assignment: "Client-Serving" channel_number: 5 - powerlevel: 2 + power_level: 2 5ghz_radio: admin_status: "Enabled" antenna_name: "AIR-ANT2513P4M-N-5GHz" radio_role_assignment: "Client-Serving" channel_number: 36 - powerlevel: 2 + power_level: 2 channel_width: "40 MHz" register: output_list @@ -1357,9 +1357,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: True + config_verify: true state: merged config: - mac_address: 6c:d6:e3:75:5a:e0 @@ -1386,7 +1386,7 @@ antenna_name: "AIR-ANT2513P4M-N-5GHz" radio_role_assignment: "Client-Serving" channel_number: 40 - powerlevel: 2 + power_level: 2 channel_width: "80 MHz" register: output_list @@ -1399,9 +1399,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: True + config_verify: true state: merged config: - mac_address: e4:38:7e:42:bc:00 @@ -1421,18 +1421,18 @@ admin_status: "Enabled" radio_role_assignment: "Client-Serving" channel_number: 3 - powerlevel: 3 + power_level: 3 5ghz_radio: admin_status: "Enabled" radio_role_assignment: "Client-Serving" channel_number: 44 - powerlevel: 3 + power_level: 3 channel_width: "20 MHz" xor_radio: admin_status: "Enabled" radio_role_assignment: "Client-Serving" channel_number: 1 - powerlevel: 3 + power_level: 3 radio_band: "6 GHz" channel_width: "40 MHz" register: output_list @@ -1446,9 +1446,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: True + config_verify: true state: merged config: - reboot_aps: @@ -1466,9 +1466,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: True + config_verify: true state: merged config: - reboot_aps: @@ -1486,9 +1486,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: True + config_verify: true state: merged config: - factory_reset_aps: @@ -1506,9 +1506,9 @@ dnac_port: "{{ dnac_port }}" dnac_version: "{{ dnac_version }}" dnac_debug: "{{ dnac_debug }}" - dnac_log: True + dnac_log: true dnac_log_level: DEBUG - config_verify: True + config_verify: true state: merged config: - bulk_update_aps: @@ -1762,7 +1762,7 @@ def validate_input_yml(self): "channel_assignment_mode": {"required": False, "type": "str"}, "channel_number": {"required": False, "type": "int"}, "power_assignment_mode": {"required": False, "type": "str"}, - "powerlevel": {"required": False, "type": "int", "range_min": 1, "range_max": 8}, + "power_level": {"required": False, "type": "int", "range_min": 1, "range_max": 8}, "channel_width": {"required": False, "type": "str"}, "radio_band": {"required": False, "type": "str"} } @@ -2001,7 +2001,7 @@ def ap_update_required(self): "primary_controller_name", "primary_ip_address", "secondary_controller_name", "address", "secondary_ip_address", "tertiary_controller_name", "tertiary_ip_address", "2.4ghz_radio", "antenna_name", "radio_role_assignment", "cable_loss", "antenna_cable_name", - "channel_assignment_mode", "channel_number", "power_assignment_mode", "powerlevel", + "channel_assignment_mode", "channel_number", "power_assignment_mode", "power_level", "antenna_gain", "channel_width", "5ghz_radio", "6ghz_radio", "xor_radio", "radio_band", "tri_radio", "dual_radio_mode" ] @@ -2445,6 +2445,7 @@ def validate_radio_parameters(self, radio_config, radio_series, errormsg): radio_config["radio_type"] = radio_type_map[radio_series] self.want[radio_series]["radio_type"] = radio_config["radio_type"] self.keymap["radio_type"] = "radioType" + self.keymap["power_level"] = "powerlevel" radio_band = radio_config.get("radio_band") antenna_name = radio_config.get("antenna_name") @@ -2521,19 +2522,19 @@ def validate_radio_parameters(self, radio_config, radio_series, errormsg): errormsg.append("power_assignment_mode: Invalid value '{0}' for Power assignment mode in playbook. Must be either 'Global' or 'Custom'." .format(power_assignment_mode)) - powerlevel = radio_config.get("powerlevel") - if powerlevel: - if powerlevel not in range(1, 9): + power_level = radio_config.get("power_level") + if power_level: + if power_level not in range(1, 9): errormsg.append( - "powerlevel: Invalid Power level '{0}' in playbook. Must be between 1 to 8." - .format(powerlevel) + "power_level: Invalid Power level '{0}' in playbook. Must be between 1 to 8." + .format(power_level) ) else: current_radio_role = self.check_current_radio_role_assignment( radio_series, self.have["current_ap_config"].get("radio_dtos", []), radio_band) if self.want.get(radio_series).get("radio_role_assignment") != "Client-Serving" and radio_series != "5ghz_radio": errormsg.append( - "powerlevel: This configuration is only supported with Client-Serving Radio Role Assignment {0} " + "power_level: This configuration is only supported with Client-Serving Radio Role Assignment {0} " .format(current_radio_role) ) @@ -3236,22 +3237,22 @@ def compare_radio_config(self, current_radio, want_radio): self.log("Desired radio configuration: {}".format(want_radio), "INFO") available_key = { "_0": ("admin_status", "antenna_gain", "antenna_name", "radio_role_assignment", - "power_assignment_mode", "powerlevel", "channel_assignment_mode", + "power_assignment_mode", "power_level", "channel_assignment_mode", "channel_number", "cable_loss", "antenna_cable_name", "radio_type", "radio_band"), "_1": ("admin_status", "antenna_gain", "antenna_name", "radio_role_assignment", - "power_assignment_mode", "powerlevel", "channel_assignment_mode", + "power_assignment_mode", "power_level", "channel_assignment_mode", "channel_number", "cable_loss", "antenna_cable_name", "channel_width", "radio_type", "radio_band", "dual_radio_mode"), "_2": ("admin_status", "radio_role_assignment", "radio_type", - "power_assignment_mode", "powerlevel", "channel_assignment_mode", + "power_assignment_mode", "power_level", "channel_assignment_mode", "channel_number", "channel_width", "dual_radio_mode", "radio_band"), "_3": ("admin_status", "antenna_gain", "antenna_name", "radio_role_assignment", - "power_assignment_mode", "powerlevel", "channel_assignment_mode", + "power_assignment_mode", "power_level", "channel_assignment_mode", "channel_number", "cable_loss", "antenna_cable_name", "radio_band", "channel_width", "radio_type"), "_4": ("admin_status", "antenna_gain", "antenna_name", "radio_role_assignment", - "power_assignment_mode", "powerlevel", "channel_assignment_mode", + "power_assignment_mode", "power_level", "channel_assignment_mode", "channel_number", "cable_loss", "antenna_cable_name", "dual_radio_mode", "channel_width", "radio_type") } @@ -3608,10 +3609,10 @@ def update_ap_configuration(self, ap_config): else: radio_dtos[self.keymap["power_assignment_mode"]] = 2 radio_dtos["configurePower"] = True - - if each_radio.get(self.keymap["powerlevel"]) is not None: - radio_dtos[self.keymap["powerlevel"]] = \ - each_radio.get(self.keymap["powerlevel"]) + self.log(self.pprint(each_radio), "INFO") + if each_radio.get(self.keymap["power_level"]) is not None: + radio_dtos[self.keymap["power_level"]] = \ + each_radio.get(self.keymap["power_level"]) radio_dtos[self.keymap["power_assignment_mode"]] = 2 radio_dtos["configurePower"] = True diff --git a/plugins/modules/sda_fabric_devices_workflow_manager.py b/plugins/modules/sda_fabric_devices_workflow_manager.py index ba0a7085af..97c37a3698 100644 --- a/plugins/modules/sda_fabric_devices_workflow_manager.py +++ b/plugins/modules/sda_fabric_devices_workflow_manager.py @@ -13,10 +13,10 @@ module: sda_fabric_devices_workflow_manager short_description: Manage SDA fabric devices in Cisco Catalyst Center. description: -- Perform operations on SDA fabric devices, including adding, updating, and deleting fabric devices. -- Manage L2 handoffs for fabric devices, including adding and deleting configurations. -- Manage L3 handoffs for fabric devices with IP transit, including adding, updating, and deleting configurations. -- Manage L3 handoffs for fabric devices with SDA transit, including adding, updating, and deleting configurations. + - Perform operations on SDA fabric devices, including adding, updating, and deleting fabric devices. + - Manage L2 handoffs for fabric devices, including adding and deleting configurations. + - Manage L3 handoffs for fabric devices with IP transit, including adding, updating, and deleting configurations. + - Manage L3 handoffs for fabric devices with SDA transit, including adding, updating, and deleting configurations. version_added: '6.21.0' extends_documentation_fragment: - cisco.dnac.workflow_manager_params @@ -26,16 +26,16 @@ config_verify: description: Set to True to verify the Cisco Catalyst Center after applying the playbook config. type: bool - default: False + default: false state: description: The state of Cisco Catalyst Center after module completion. type: str - choices: [ merged, deleted ] + choices: [merged, deleted] default: merged config: description: - - A list of SDA fabric device configurations associated with fabric sites. - - Each entry in the list represents the configurations for devices within a fabric site. + - A list of SDA fabric device configurations associated with fabric sites. + - Each entry in the list represents the configurations for devices within a fabric site. type: list elements: dict required: true @@ -46,12 +46,12 @@ suboptions: fabric_name: description: - - Name of the SDA fabric site. - - Mandatory parameter for all operations under fabric_devices. - - The fabric site must already be created before configuring devices. - - A Fabric Site is composed of networking devices operating in SD-Access Fabric roles. - - A fabric site consists of networking devices in SD-Access Fabric roles, including Border Nodes, Control Plane Nodes, and Edge Nodes. - - A Fabric sites may also include Fabric Wireless LAN Controllers and Fabric Wireless Access Points. + - Name of the SDA fabric site. + - Mandatory parameter for all operations under fabric_devices. + - The fabric site must already be created before configuring devices. + - A Fabric Site is composed of networking devices operating in SD-Access Fabric roles. + - A fabric site consists of networking devices in SD-Access Fabric roles, including Border Nodes, Control Plane Nodes, and Edge Nodes. + - A Fabric sites may also include Fabric Wireless LAN Controllers and Fabric Wireless Access Points. type: str required: true device_config: @@ -63,55 +63,54 @@ suboptions: device_ip: description: - - IP address of the device to be added to the fabric site. - - Mandatory parameter for all operations under fabric_devices. - - Device must be provisioned to the site prior to configuration. + - IP address of the device to be added to the fabric site. + - Mandatory parameter for all operations under fabric_devices. + - Device must be provisioned to the site prior to configuration. type: str required: true delete_fabric_device: description: - - Effective only when the state is deleted. - - Set to true to delete the device from the fabric site, or false to retain it. + - Effective only when the state is deleted. + - Set to true to delete the device from the fabric site, or false to retain it. type: bool device_roles: description: - - Specifies the role(s) of the device within the fabric site. - - This parameter is required when adding the device to the fabric site. - - The device roles cannot be updated once assigned. - - At least one device must be a CONTROL_PLANE_NODE to assign roles to other devices. - - Available roles, - - CONTROL_PLANE_NODE - Manages the mapping of endpoint IP addresses to their location - within the network using LISP, enabling mobility. - - EDGE_NODE - Connects endpoints to the SDA network, handling policy enforcement, - segmentation, and communication with the control plane. - - BORDER_NODE - Acts as the gateway between the fabric and external networks, - managing traffic entering or exiting the SDA environment. - - WIRELESS_CONTROLLER_NODE - Manages and controls wireless access points and - devices within the network. - - For 'WIRELESS_CONTROLLER_NODE', the check for the provisioning status will be added in 2.3.7.6 SDK. + - Specifies the role(s) of the device within the fabric site. + - This parameter is required when adding the device to the fabric site. + - The device roles cannot be updated once assigned. + - At least one device must be a CONTROL_PLANE_NODE to assign roles to other devices. + - Available roles, + - CONTROL_PLANE_NODE - Manages the mapping of endpoint IP addresses to their location + within the network using LISP, enabling mobility. + - EDGE_NODE - Connects endpoints to the SDA network, handling policy enforcement, + segmentation, and communication with the control plane. + - BORDER_NODE - Acts as the gateway between the fabric and external networks, + managing traffic entering or exiting the SDA environment. + - WIRELESS_CONTROLLER_NODE - Manages and controls wireless access points and + devices within the network. + - For 'WIRELESS_CONTROLLER_NODE', the check for the provisioning status will be added in 2.3.7.6 SDK. choices: [CONTROL_PLANE_NODE, EDGE_NODE, BORDER_NODE, WIRELESS_CONTROLLER_NODE] type: list elements: str route_distribution_protocol: description: - - Specifies the Route Distribution Protocol for the Control Plane Device. - - The route distribution protocol manages routing information across network segments. - - Available protocols, - - LISP_BGP - Location/ID Separation Protocol with a publish-subscribe mechanism - for distributing routing information. - - LISP_PUB_SUB - Location/ID Separation Protocol with BGP, where BGP serves as the control plane - to advertise and manage routing information within LISP networks. + - Specifies the Route Distribution Protocol for the Control Plane Device. + - The route distribution protocol manages routing information across network segments. + - Available protocols, + - LISP_BGP - Location/ID Separation Protocol with a publish-subscribe mechanism + for distributing routing information. + - LISP_PUB_SUB - Location/ID Separation Protocol with BGP, where BGP serves as the control plane + to advertise and manage routing information within LISP networks. choices: [LISP_BGP, LISP_PUB_SUB] default: LISP_BGP - type: list - elements: str + type: str borders_settings: description: - - Effective only when the 'device_roles' contains BORDER_NODE. - - This parameter is required when adding the device to a fabric site with the `BORDER_NODE` role. - - Updates to `borders_settings` are allowed after the initial configuration. - - Border type can be Layer2 or Layer3. - - Border type can be Layer2 or Layer3, identified based on the presence of L2 Handoff or L3 Handoff with IP or SDA transit. + - Effective only when the 'device_roles' contains BORDER_NODE. + - This parameter is required when adding the device to a fabric site with the `BORDER_NODE` role. + - Updates to `borders_settings` are allowed after the initial configuration. + - Border type can be Layer2 or Layer3. + - Border type can be Layer2 or Layer3, identified based on the presence of L2 Handoff or L3 Handoff with IP or SDA transit. type: dict suboptions: layer3_settings: @@ -121,201 +120,201 @@ suboptions: local_autonomous_system_number: description: - - Identifies the local autonomous system in BGP routing. - - This parameter is required when adding a device with the `BORDER_NODE` role. - - The `local_autonomous_system_number` cannot be updated once set. - - Acceptable range is from 1 to 4,294,967,295. - - Dot notation (1.0 to 65535.65535) is also allowed. For example, 65534.65535. + - Identifies the local autonomous system in BGP routing. + - This parameter is required when adding a device with the `BORDER_NODE` role. + - The `local_autonomous_system_number` cannot be updated once set. + - Acceptable range is from 1 to 4,294,967,295. + - Dot notation (1.0 to 65535.65535) is also allowed. For example, 65534.65535. type: str is_default_exit: description: - - Indicates whether this Border Node serves as the default gateway for traffic exiting the virtual network. - - The `is_default_exit` cannot be updated. + - Indicates whether this Border Node serves as the default gateway for traffic exiting the virtual network. + - The `is_default_exit` cannot be updated. type: bool default: true import_external_routes: description: - - Determines whether routes from external networks are imported into the fabric. - - Enhances security by limiting route usage to internal routes. - - The 'import_external_routes' cannot be updated. + - Determines whether routes from external networks are imported into the fabric. + - Enhances security by limiting route usage to internal routes. + - The 'import_external_routes' cannot be updated. type: bool default: true border_priority: description: - - Sets the preference level for this Border Node when multiple border nodes are present. - - Higher-priority nodes are favored for routing traffic to external networks. - - Acceptable range is from 1 to 9. If not set, the default value is 10. - - This parameter can be updated. + - Sets the preference level for this Border Node when multiple border nodes are present. + - Higher-priority nodes are favored for routing traffic to external networks. + - Acceptable range is from 1 to 9. If not set, the default value is 10. + - This parameter can be updated. type: int default: 10 prepend_autonomous_system_count: description: - - Increases the AS path length artificially when advertising routes via BGP. - - It makes the route less attractive to external peers. - - Acceptable range is from 1 to 10. If not set, the default value is 0. - - This parameter can be updated. + - Increases the AS path length artificially when advertising routes via BGP. + - It makes the route less attractive to external peers. + - Acceptable range is from 1 to 10. If not set, the default value is 0. + - This parameter can be updated. type: int default: 0 layer3_handoff_ip_transit: description: - - Adds layer 3 handoffs with ip transit in fabric devices. - - Configured when IP traffic is routed from the SDA fabric to external networks. - - If 'layer3_handoff_ip_transit' is set, border type will be considered as Layer3. + - Adds layer 3 handoffs with ip transit in fabric devices. + - Configured when IP traffic is routed from the SDA fabric to external networks. + - If 'layer3_handoff_ip_transit' is set, border type will be considered as Layer3. type: list elements: dict suboptions: transit_network_name: description: - - Network that connects multiple SDA fabrics or networks. - - Required for all operations in L3 Handoff with IP transit. - - It is not possible to update `transit_network_name` after initial configuration. + - Network that connects multiple SDA fabrics or networks. + - Required for all operations in L3 Handoff with IP transit. + - It is not possible to update `transit_network_name` after initial configuration. type: str interface_name: description: - - Refers to the specific network interface in the border device. - - This parameter is required for all operations in L3 Handoff with IP transit. - - This parameter cannot be updated after being set. + - Refers to the specific network interface in the border device. + - This parameter is required for all operations in L3 Handoff with IP transit. + - This parameter cannot be updated after being set. type: str external_connectivity_ip_pool_name: description: - - Denotes the IP address range allocated for communication between the SDA fabric and external networks. - - This parameter is required for adding the L3 Handoff with IP transit. - - The IP pool must be reserved in the fabric site. - - If `external_connectivity_ip_pool_name` is specified, there is no need to set the local and remote addresses. - - Specifying `external_connectivity_ip_pool_name` will automatically configure the local and remote addresses. - - If both are set, `external_connectivity_ip_pool_name` takes precedence. - - Updating IP addresses is not permitted. + - Denotes the IP address range allocated for communication between the SDA fabric and external networks. + - This parameter is required for adding the L3 Handoff with IP transit. + - The IP pool must be reserved in the fabric site. + - If `external_connectivity_ip_pool_name` is specified, there is no need to set the local and remote addresses. + - Specifying `external_connectivity_ip_pool_name` will automatically configure the local and remote addresses. + - If both are set, `external_connectivity_ip_pool_name` takes precedence. + - Updating IP addresses is not permitted. type: str virtual_network_name: description: - - Refers to the logical segmentation of the network, grouping devices into isolated virtual networks. - - Either `virtual_network_name` or `vlan_id` is required for all operations in L3 Handoff with IP transit. + - Refers to the logical segmentation of the network, grouping devices into isolated virtual networks. + - Either `virtual_network_name` or `vlan_id` is required for all operations in L3 Handoff with IP transit. type: str vlan_id: description: - - Unique identifier assigned to a Virtual Local Area Network (VLAN). - - Should be unique across the entire fabric site settings. - - The 'vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. - - Either `virtual_network_name` or `vlan_id` is required for all operations in L3 Handoff with IP transit. - - This parameter cannot be updated once set. + - Unique identifier assigned to a Virtual Local Area Network (VLAN). + - Should be unique across the entire fabric site settings. + - The 'vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. + - Either `virtual_network_name` or `vlan_id` is required for all operations in L3 Handoff with IP transit. + - This parameter cannot be updated once set. type: int tcp_mss_adjustment: description: - - Allows the modification of the Maximum Segment Size in TCP packets. - - The 'tcp_mss_adjustment' can be set from 500 to 1440. - - This parameter can be updated after being initially set. + - Allows the modification of the Maximum Segment Size in TCP packets. + - The 'tcp_mss_adjustment' can be set from 500 to 1440. + - This parameter can be updated after being initially set. type: int local_ip_address: description: - - IP address assigned to a device's interface within the fabric. - - The 'local_ip_address' is for IPv4. - - Both 'local_ip_address' and 'remote_ip_address' must fall within the same subnet. - - Either local and remote addresses or `external_connectivity_ip_pool_name` is required. - - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', - `external_connectivity_ip_pool_name` takes precedence. + - IP address assigned to a device's interface within the fabric. + - The 'local_ip_address' is for IPv4. + - Both 'local_ip_address' and 'remote_ip_address' must fall within the same subnet. + - Either local and remote addresses or `external_connectivity_ip_pool_name` is required. + - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', + `external_connectivity_ip_pool_name` takes precedence. type: str remote_ip_address: description: - - IP address of a device located outside the fabric network, often used for BGP peering. - - The 'remote_ip_address' is for IPv4. - - Both 'local_ip_address' and 'remote_ip_address' must fall within the same subnet. - - Either local and remote addresses or `external_connectivity_ip_pool_name` is required. - - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', - `external_connectivity_ip_pool_name` takes precedence. + - IP address of a device located outside the fabric network, often used for BGP peering. + - The 'remote_ip_address' is for IPv4. + - Both 'local_ip_address' and 'remote_ip_address' must fall within the same subnet. + - Either local and remote addresses or `external_connectivity_ip_pool_name` is required. + - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', + `external_connectivity_ip_pool_name` takes precedence. type: str local_ipv6_address: description: - - IP address assigned to a device's interface within the fabric. - - The local_ipv6_address is for IPv6. - - Both 'local_ipv6_address' and 'remote_ipv6_address' must fall within the same subnet. - - If 'remote_ipv6_address' is provided, then 'local_ipv6_address' is required. - - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', - `external_connectivity_ip_pool_name` takes precedence. + - IP address assigned to a device's interface within the fabric. + - The local_ipv6_address is for IPv6. + - Both 'local_ipv6_address' and 'remote_ipv6_address' must fall within the same subnet. + - If 'remote_ipv6_address' is provided, then 'local_ipv6_address' is required. + - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', + `external_connectivity_ip_pool_name` takes precedence. type: str remote_ipv6_address: description: - - IP address of a device located outside the fabric network, often used for BGP peering. - - The 'remote_ipv6_address' is for IPv6. - - Both 'local_ipv6_address' and 'remote_ipv6_address' must fall within the same subnet. - - If 'local_ipv6_address' is provided, then 'remote_ipv6_address' is required. - - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', - `external_connectivity_ip_pool_name` takes precedence. + - IP address of a device located outside the fabric network, often used for BGP peering. + - The 'remote_ipv6_address' is for IPv6. + - Both 'local_ipv6_address' and 'remote_ipv6_address' must fall within the same subnet. + - If 'local_ipv6_address' is provided, then 'remote_ipv6_address' is required. + - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', + `external_connectivity_ip_pool_name` takes precedence. type: str layer3_handoff_sda_transit: description: - - Adds layer 3 handoffs with SDA transit in fabric devices. - - Configured when routing traffic is routed from the SDA fabric to external networks. - - If 'layer3_handoff_sda_transit' is set, border type will be considered as Layer3. + - Adds layer 3 handoffs with SDA transit in fabric devices. + - Configured when routing traffic is routed from the SDA fabric to external networks. + - If 'layer3_handoff_sda_transit' is set, border type will be considered as Layer3. type: dict suboptions: transit_network_name: description: - - Network that connects multiple SDA fabrics or networks. - - This parameter is required for all operations in L3 Handoff with SDA transit. - - The transit_network_name cannot be updated. + - Network that connects multiple SDA fabrics or networks. + - This parameter is required for all operations in L3 Handoff with SDA transit. + - The transit_network_name cannot be updated. type: str affinity_id_prime: description: - - It supersedes the border priority to determine border node preference. - - The lower the relative value of 'affinity_id_prime', the higher the preference. - - Resources with the same affinity ID are treated similarly and affinity_id_decider decides the priority. - - The 'affinity_id_prime' ranges from 0 to 2147483647. - - The 'affinity_id_prime' can be updated. + - It supersedes the border priority to determine border node preference. + - The lower the relative value of 'affinity_id_prime', the higher the preference. + - Resources with the same affinity ID are treated similarly and affinity_id_decider decides the priority. + - The 'affinity_id_prime' ranges from 0 to 2147483647. + - The 'affinity_id_prime' can be updated. type: int affinity_id_decider: description: - - If the 'affinity_id_prime' value is the same, the 'affinity_id_decider' value is used as a tiebreaker. - - The lower the relative value of 'affinity_id_decider', the higher the preference. - - The 'affinity_id_decider' ranges from 0 to 2147483647. - - The 'affinity_id_decider' can be updated. + - If the 'affinity_id_prime' value is the same, the 'affinity_id_decider' value is used as a tiebreaker. + - The lower the relative value of 'affinity_id_decider', the higher the preference. + - The 'affinity_id_decider' ranges from 0 to 2147483647. + - The 'affinity_id_decider' can be updated. type: int connected_to_internet: description: - - Set this true to allow associated site to provide internet access to other sites through SDA. - - Default value is false. - - This parameter can be updated. + - Set this true to allow associated site to provide internet access to other sites through SDA. + - Default value is false. + - This parameter can be updated. type: bool default: false is_multicast_over_transit_enabled: description: - - Set this true to configure native multicast over multiple sites that are connected to an SDA transit. - - Default value is false. - - This parameter can be updated. + - Set this true to configure native multicast over multiple sites that are connected to an SDA transit. + - Default value is false. + - This parameter can be updated. type: bool default: false layer2_handoff: description: - - Adds layer 2 handoffs in fabric devices. - - This parameter cannots be updated. - - Configured while transferring a device's data traffic at Layer 2 (Data Link layer). - - If 'layer2_handoff' is set, the border type will be considered as Layer2. + - Adds layer 2 handoffs in fabric devices. + - This parameter cannots be updated. + - Configured while transferring a device's data traffic at Layer 2 (Data Link layer). + - If 'layer2_handoff' is set, the border type will be considered as Layer2. type: list elements: dict suboptions: interface_name: description: - - Refers to the specific network interface in the border device. - - This parameter is required for all operations in L2 Handoff. - - The 'interface_name' cannot be updated. + - Refers to the specific network interface in the border device. + - This parameter is required for all operations in L2 Handoff. + - The 'interface_name' cannot be updated. type: str internal_vlan_id: description: - - Represents the VLAN identifier used within the fabric for traffic segmentation among devices. - - Should be unique across the entire fabric site settings. - - This parameter is required for all operations in layer2_handoff. - - The 'internal_vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. + - Represents the VLAN identifier used within the fabric for traffic segmentation among devices. + - Should be unique across the entire fabric site settings. + - This parameter is required for all operations in layer2_handoff. + - The 'internal_vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. type: int external_vlan_id: description: - - Represents to the VLAN identifier used for traffic that exits the fabric to external networks. - - Should be unique across the entire fabric site settings. - - This parameter is required for all operations in 'layer2_handoff'. - - The 'external_vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. + - Represents to the VLAN identifier used for traffic that exits the fabric to external networks. + - Should be unique across the entire fabric site settings. + - This parameter is required for all operations in 'layer2_handoff'. + - The 'external_vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. type: int requirements: -- dnacentersdk >= 2.9.2 -- python >= 3.9 + - dnacentersdk >= 2.9.2 + - python >= 3.9 notes: - SDK Method used are site_design.SiteDesign.get_sites, @@ -529,7 +528,7 @@ external_connectivity_ip_pool_name: Reserved_sda_test_1 virtual_network_name: L3VN1 vlan_id: 440 - tcp_mss_adjustment: 2 + tcp_mss_adjustment: 501 - name: Add L3 Handoff with IP Transit to the SDA fabric device with local and remote network cisco.dnac.sda_fabric_devices_workflow_manager: @@ -2174,6 +2173,12 @@ def get_have_fabric_devices(self, fabric_devices): "The provided 'fabric_name' '{fabric_name}' is not valid a fabric site." .format(fabric_name=fabric_name) ) + if self.params.get("state") == "deleted": + self.log(self.msg, "INFO") + self.result.get("response").append({"msg": self.msg}) + self.status = "exited" + return self + self.log(self.msg, "ERROR") self.status = "failed" return self diff --git a/plugins/modules/sda_fabric_sites_zones_workflow_manager.py b/plugins/modules/sda_fabric_sites_zones_workflow_manager.py index d3dfa637ea..0d9630006d 100644 --- a/plugins/modules/sda_fabric_sites_zones_workflow_manager.py +++ b/plugins/modules/sda_fabric_sites_zones_workflow_manager.py @@ -14,13 +14,13 @@ module: sda_fabric_sites_zones_workflow_manager short_description: Manage fabric site(s)/zone(s) and update the authentication profile template in Cisco Catalyst Center. description: -- Creating fabric site(s) for the SDA operation in Cisco Catalyst Center. -- Updating fabric site(s) for the SDA operation in Cisco Catalyst Center. -- Creating fabric zone(s) for the SDA operation in Cisco Catalyst Center. -- Updating fabric zone(s) for the SDA operation in Cisco Catalyst Center. -- Deletes fabric site(s) from Cisco Catalyst Center. -- Deletes fabric zone(s) from Cisco Catalyst Center. -- Configure the authentication profile template for fabric site/zone in Cisco Catalyst Center. + - Creating fabric site(s) for the SDA operation in Cisco Catalyst Center. + - Updating fabric site(s) for the SDA operation in Cisco Catalyst Center. + - Creating fabric zone(s) for the SDA operation in Cisco Catalyst Center. + - Updating fabric zone(s) for the SDA operation in Cisco Catalyst Center. + - Deletes fabric site(s) from Cisco Catalyst Center. + - Deletes fabric zone(s) from Cisco Catalyst Center. + - Configure the authentication profile template for fabric site/zone in Cisco Catalyst Center. version_added: '6.17.0' extends_documentation_fragment: - cisco.dnac.workflow_manager_params @@ -30,11 +30,11 @@ config_verify: description: Set to True to verify the Cisco Catalyst Center configuration after applying the playbook configuration. type: bool - default: False + default: false state: description: The desired state of Cisco Catalyst Center after the module execution. type: str - choices: [ merged, deleted ] + choices: [merged, deleted] default: merged config: description: A list containing detailed configurations for creating, updating, or deleting fabric sites or zones @@ -44,7 +44,7 @@ to authentication profiles. type: list elements: dict - required: True + required: true suboptions: fabric_sites: description: A dictionary containing detailed configurations for managing REST Endpoints that will receive Audit log @@ -57,13 +57,13 @@ sites or zones, as well as for updating the authentication profile template. This parameter is mandatory for any fabric site/zone management operation. type: str - required: True + required: true fabric_type: description: Specifies the type of site to be managed within the SDA environment. The acceptable values are 'fabric_site' and 'fabric_zone'. The default value is 'fabric_site', indicating the configuration of a broader network area, whereas 'fabric_zone' typically refers to a more specific segment within the site. type: str - required: True + required: true authentication_profile: description: The authentication profile applied to the specified fabric. This profile determines the security posture and controls for network access within the site. Possible values include 'Closed Authentication', 'Low Impact', @@ -107,8 +107,8 @@ requirements: -- dnacentersdk >= 2.9.2 -- python >= 3.9 + - dnacentersdk >= 2.9.2 + - python >= 3.9 notes: - To ensure the module operates correctly for scaled sets, which involve creating or updating fabric sites/zones and handling @@ -1339,10 +1339,18 @@ def get_diff_merged(self, config): # Create/Update Fabric sites/zones in Cisco Catalyst Center raw_fabric_sites = self.want.get('fabric_sites') - # Convert each dictionary to a sorted tuple of key-value pairs - unique_fabric_sites = {tuple(sorted(d.items())) for d in raw_fabric_sites} - # Convert each unique tuple back into a dictionary - fabric_sites = [dict(t) for t in unique_fabric_sites] + # Preserve the order of input while deduplicating + self.log("Starting deduplication of raw_fabric_sites.", "DEBUG") + unique_fabric_site_set = set() + fabric_sites = [] + for fabric_site_dict in raw_fabric_sites: + # Convert dictionary to a frozenset - immutable set + site_zone = frozenset(fabric_site_dict.items()) + if site_zone not in unique_fabric_site_set: + self.log("New unique site found: '{0}'".format(site_zone), "DEBUG") + unique_fabric_site_set.add(site_zone) + fabric_sites.append(fabric_site_dict) + self.log("Deduplication complete. Total unique sites: {0}".format(len(fabric_sites)), "DEBUG") for site in fabric_sites: site_name = site.get("site_name_hierarchy") @@ -1497,7 +1505,20 @@ def get_diff_deleted(self, config): self.set_operation_result("failed", False, self.msg, "ERROR") return self - fabric_sites = self.want.get('fabric_sites') + raw_fabric_sites = self.want.get('fabric_sites') + # Preserve the order of input while deduplicating + self.log("Starting deduplication of raw_fabric_sites.", "DEBUG") + unique_fabric_site_set = set() + fabric_sites = [] + for fabric_site_dict in raw_fabric_sites: + # Convert dictionary to a frozenset - immutable set + site_zone = frozenset(fabric_site_dict.items()) + if site_zone not in unique_fabric_site_set: + self.log("New unique site found: '{0}'".format(site_zone), "DEBUG") + unique_fabric_site_set.add(site_zone) + fabric_sites.append(fabric_site_dict) + + self.log("Deduplication complete. Total unique sites: {0}".format(len(fabric_sites)), "DEBUG") fabric_site_dict = {} for site in fabric_sites: diff --git a/plugins/modules/sda_fabric_virtual_networks_workflow_manager.py b/plugins/modules/sda_fabric_virtual_networks_workflow_manager.py index 64b13593ec..9160e167fd 100644 --- a/plugins/modules/sda_fabric_virtual_networks_workflow_manager.py +++ b/plugins/modules/sda_fabric_virtual_networks_workflow_manager.py @@ -14,9 +14,9 @@ module: sda_fabric_virtual_networks_workflow_manager short_description: Configure fabric VLANs, Virtual Networks, and Anycast Gateways in Cisco Catalyst Center. description: -- Create, update, or delete layer2 Fabric VLAN(s) for SDA operations in Cisco Catalyst Center. -- Create, update, or delete layer3 Virtual Network(s) for SDA operations in Cisco Catalyst Center. -- Create, update, or delete Anycast Gateway(s) for SDA operations in Cisco Catalyst Center. + - Create, update, or delete layer2 Fabric VLAN(s) for SDA operations in Cisco Catalyst Center. + - Create, update, or delete layer3 Virtual Network(s) for SDA operations in Cisco Catalyst Center. + - Create, update, or delete Anycast Gateway(s) for SDA operations in Cisco Catalyst Center. version_added: '6.18.0' extends_documentation_fragment: - cisco.dnac.workflow_manager_params @@ -26,12 +26,17 @@ config_verify: description: Set to True to verify the Cisco Catalyst Center config after applying the playbook config. type: bool - default: False + default: false state: description: The state of Cisco Catalyst Center after module completion. type: str - choices: [ merged, deleted ] + choices: [merged, deleted] default: merged + sda_fabric_vlan_limit: + description: Set the limit for creating/updating fabric VLAN(s) via the SDA API, consistent with the GUI constraints. + By default it is set to 50 as in the GUI we can only create 50 fabric VLAN(s) at a time. + type: int + default: 50 config: description: A list containing detailed configurations for creating, updating, or deleting fabric sites/zones in a Software-Defined Access (SDA) environment. It also includes specifications for updating the authentication @@ -40,7 +45,7 @@ to authentication profiles. type: list elements: dict - required: True + required: true suboptions: fabric_vlan: description: A list of VLAN configurations for fabric sites in SDA environment. Each VLAN entry @@ -52,14 +57,14 @@ description: Name of the VLAN of the layer2 virtual network. Must contain only alphanumeric characters, underscores, and hyphens. Updating this field is not allowed. type: str - required: True + required: true vlan_id: description: ID for the layer2 VLAN network. Allowed VLAN range is 2-4093 except for reserved VLANs 1002-1005, and 2046. If deploying on a fabric zone, this vlan_id must match the vlan_id of the corresponding layer2 virtual network on the fabric site. And updation of this field is not allowed. type: int - required: True + required: true fabric_site_locations: description: A list of fabric site locations where this VLAN is deployed, including site hierarchy and fabric type details. type: list @@ -69,17 +74,17 @@ description: This name uniquely identifies the site for operations such as creating/updating/deleting any fabric VLAN. This parameter is required, and updates to this field is not allowed. type: str - required: True + required: true fabric_type: description: Specifies the type of site to be managed within the SDA environment. The acceptable values are 'fabric_site' and 'fabric_zone'. The default value is 'fabric_site', indicating the configuration of a broader network area, whereas 'fabric_zone' typically refers to a more specific segment within the site. type: str - required: True + required: true traffic_type: description: The type of traffic handled by the VLAN (e.g., DATA, VOICE). By default, it is set to "DATA". type: str - required: True + required: true fabric_enabled_wireless: description: Indicates whether the fabric VLAN is enabled for wireless in the fabric environment. By default, it is set to False. type: bool @@ -100,7 +105,7 @@ field is not allowed. It consist of only letters, numbers, and underscores, and must be between 1-16 characters in length. type: str - required: True + required: true fabric_site_locations: description: A list of fabric site locations where this this Layer3 virtual network is to be assigned to, including site hierarchy and fabric type details. If this parameter is given make sure to provide the site_name and fabric_type as @@ -135,13 +140,13 @@ description: The name of the Layer3 virtual network. It must consist only of letters, numbers, and underscores, with a length between 1 and 16 characters. This field cannot be updated after creation. type: str - required: True + required: true fabric_site_locations: description: A list of fabric site locations where this Layer3 virtual network will be assigned, including details about the site hierarchy and fabric type. If this parameter is provided, ensure that both site_name and fabric_type are specified for each entry. This is required to extend the virtual networks across the specified fabric sites. type: dict - required: True + required: true suboptions: site_name_hierarchy: description: The hierarchical name of the site where the anycast gateway is deployed. @@ -157,7 +162,7 @@ if it does not exist, it can be created or reserved using the 'network_settings_workflow_manager' module. Updating this field is not allowed. type: str - required: True + required: true tcp_mss_adjustment: description: The value used to adjust the TCP Maximum Segment Size (MSS). The value should be in the range (500, 1441). type: int @@ -232,8 +237,8 @@ requirements: -- dnacentersdk >= 2.9.2 -- python >= 3.9 + - dnacentersdk >= 2.9.2 + - python >= 3.9 notes: - To ensure the module operates correctly for scaled sets, which involve creating, updating, or deleting Layer2 fabric VLANs @@ -987,26 +992,40 @@ def create_fabric_vlan(self, vlan_payloads): class status accordingly. """ - try: - payload = {"payload": vlan_payloads} - task_name = "add_layer2_virtual_networks" - task_id = self.get_taskid_post_api_call("sda", task_name, payload) + req_limit = self.params.get('sda_fabric_vlan_limit', 50) + self.log( + "API request batch size set to '{0}' for fabric VLAN creation.".format(req_limit), "DEBUG" + ) - if not task_id: - self.msg = "Unable to retrieve the task_id for the task '{0}'.".format(task_name) - self.set_operation_result("failed", False, self.msg, "ERROR") - return self + for i in range(0, len(vlan_payloads), req_limit): + fabric_vlan_payload = vlan_payloads[i: i + req_limit] + fabric_vlan_details = self.created_fabric_vlans[i: i + req_limit] - success_msg = "Layer2 Fabric VLAN(s) '{0}' created successfully in the Cisco Catalyst Center.".format(self.created_fabric_vlans) - self.log(success_msg, "DEBUG") - self.get_task_status_from_tasks_by_id(task_id, task_name, success_msg) + try: + payload = {"payload": fabric_vlan_payload} + task_name = "add_layer2_virtual_networks" + task_id = self.get_taskid_post_api_call("sda", task_name, payload) - except Exception as e: - self.msg = ( - "An exception occured while creating the layer2 VLAN(s) '{0}' in the Cisco Catalyst " - "Center: {1}" - ).format(self.created_fabric_vlans, str(e)) - self.set_operation_result("failed", False, self.msg, "ERROR") + if not task_id: + self.msg = ( + "Failed to retrieve task ID for task '{0}'. Payload: '{1}'".format( + task_name, payload + ) + ) + self.msg = "Unable to retrieve the task_id for the task '{0}'.".format(task_name) + self.set_operation_result("failed", False, self.msg, "ERROR") + return self + + success_msg = "Layer2 Fabric VLAN(s) '{0}' created successfully in the Cisco Catalyst Center.".format(fabric_vlan_details) + self.log(success_msg, "DEBUG") + self.get_task_status_from_tasks_by_id(task_id, task_name, success_msg).check_return_status() + + except Exception as e: + self.msg = ( + "An exception occured while creating the layer2 VLAN(s) '{0}' in the Cisco Catalyst " + "Center: {1}" + ).format(self.fabric_vlan_details, str(e)) + self.set_operation_result("failed", False, self.msg, "ERROR").check_return_status() return self @@ -1114,34 +1133,42 @@ def update_fabric_vlan(self, update_vlan_payload): and sets the status to "failed". """ - try: - payload = {"payload": update_vlan_payload} - task_name = "update_layer2_virtual_networks" - task_id = self.get_taskid_post_api_call("sda", task_name, payload) + req_limit = self.params.get('sda_fabric_vlan_limit', 50) + self.log( + "API request batch size set to '{0}' for fabric VLAN updation.".format(req_limit), "DEBUG" + ) - if not task_id: - self.msg = "Unable to retrieve the task_id for the task '{0}'.".format(task_name) - self.set_operation_result("failed", False, self.msg, "ERROR") - return self + for i in range(0, len(update_vlan_payload), req_limit): + vlan_payload = update_vlan_payload[i: i + req_limit] + fabric_vlan_details = self.created_fabric_vlans[i: i + req_limit] - success_msg = "Layer2 Fabric VLAN(s) '{0}' updated successfully in the Cisco Catalyst Center.".format(self.updated_fabric_vlans) - self.get_task_status_from_tasks_by_id(task_id, task_name, success_msg) + try: + payload = {"payload": vlan_payload} + task_name = "update_layer2_virtual_networks" + task_id = self.get_taskid_post_api_call("sda", task_name, payload) - except Exception as e: - self.msg = ( - "An exception occured while updating the layer2 fabric VLAN(s) '{0}' in the Cisco Catalyst " - "Center: {1}" - ).format(self.updated_fabric_vlans, str(e)) - self.set_operation_result("failed", False, self.msg, "ERROR") + if not task_id: + self.msg = "Unable to retrieve the task_id for the task '{0}'.".format(task_name) + self.set_operation_result("failed", False, self.msg, "ERROR") + return self + + success_msg = "Layer2 Fabric VLAN(s) '{0}' updated successfully in the Cisco Catalyst Center.".format(fabric_vlan_details) + self.get_task_status_from_tasks_by_id(task_id, task_name, success_msg).check_return_status() + + except Exception as e: + self.msg = ( + "An exception occured while updating the layer2 fabric VLAN(s) '{0}' in the Cisco Catalyst " + "Center: {1}" + ).format(fabric_vlan_details, str(e)) + self.set_operation_result("failed", False, self.msg, "ERROR").check_return_status() return self - def delete_layer2_fabric_vlan(self, vlan_name, vlan_vn_id, vlan_name_with_id_and_site): + def delete_layer2_fabric_vlan(self, vlan_vn_id, vlan_name_with_id_and_site): """ Deletes a Layer2 fabric VLAN in Cisco Catalyst Center based on the provided VLAN ID. Args: self (object): An instance of a class used for interacting with Cisco Catalyst Center. - vlan_name (str): The name of the Fabric VLAN to be deleted. vlan_vn_id (str): The unique identifier of the Fabric VLAN to be deleted. vlan_name_with_id_and_site (str): Uniquely identify the name of vlan with it's VLAN id and to the site(s) it is assoicated with @@ -1173,7 +1200,7 @@ class status accordingly. except Exception as e: self.msg = "Exception occurred while deleting the fabric Vlan '{0}' due to: {1}".format(vlan_name_with_id_and_site, str(e)) - self.set_operation_result("failed", False, self.msg, "ERROR").check_return_status() + self.set_operation_result("failed", False, self.msg, "ERROR") return self @@ -2572,11 +2599,11 @@ def update_fabric_vlan_vn_anycast_gateway_messages(self): result_msg_list.append(create_vn_msg) if self.updated_virtual_networks: - update_vn_msg = "Layer3 Virtual Network(s '{0}' updated successfully in the Cisco Catalyst Center.".format(self.updated_virtual_networks) + update_vn_msg = "Layer3 Virtual Network(s) '{0}' updated successfully in the Cisco Catalyst Center.".format(self.updated_virtual_networks) result_msg_list.append(update_vn_msg) if self.no_update_virtual_networks: - no_update_vns_msg = "Given Virtual Network(s '{0}' does not need any update in Cisco Catalyst Center.".format(self.no_update_virtual_networks) + no_update_vns_msg = "Given Virtual Network(s) '{0}' does not need any update in Cisco Catalyst Center.".format(self.no_update_virtual_networks) result_msg_list.append(no_update_vns_msg) if self.created_anycast_gateways: @@ -2920,13 +2947,13 @@ def delete_fabric_vlan(self, fabric_vlan_details): name_id_site_key = "{0}${1}${2}".format(vlan_name, vlan_id, site_name) fabric_site_dict[name_id_site_key] = fabric_vlan_id else: - self.delete_layer2_fabric_vlan(vlan_name, fabric_vlan_id, vlan_name_with_id_and_site).check_return_status() + self.delete_layer2_fabric_vlan(fabric_vlan_id, vlan_name_with_id_and_site).check_return_status() self.log("Successfully deleted fabric VLAN '{0}' from Cisco Catalyst Center.".format(vlan_name_with_id_and_site), "INFO") for name_id_key, fabric_vlan_id in fabric_site_dict.items(): vlan_name, vlan_id, site_name = name_id_key.split("$") vlan_name_with_id_and_site = "{0} having vlan id: {1} and site: {2}".format(vlan_name, vlan_id, site_name) - self.delete_layer2_fabric_vlan(vlan_name, fabric_vlan_id, vlan_name_with_id_and_site).check_return_status() + self.delete_layer2_fabric_vlan(fabric_vlan_id, vlan_name_with_id_and_site).check_return_status() self.log("Successfully deleted fabric VLAN '{0}' from Cisco Catalyst Center.".format(vlan_name_with_id_and_site), "INFO") if self.deleted_fabric_vlans: @@ -3542,6 +3569,7 @@ def main(): 'dnac_log': {'type': 'bool', 'default': False}, 'validate_response_schema': {'type': 'bool', 'default': True}, 'config_verify': {'type': 'bool', "default": False}, + 'sda_fabric_vlan_limit': {'type': 'int', 'default': 50}, 'dnac_api_task_timeout': {'type': 'int', "default": 1200}, 'dnac_task_poll_interval': {'type': 'int', "default": 2}, 'config': {'required': True, 'type': 'list', 'elements': 'dict'}, diff --git a/plugins/modules/site_workflow_manager.py b/plugins/modules/site_workflow_manager.py index a63f153c05..2a7119b9a7 100644 --- a/plugins/modules/site_workflow_manager.py +++ b/plugins/modules/site_workflow_manager.py @@ -1691,7 +1691,8 @@ def get_diff_merged(self, config): for site in self.handle_config[each_type]: if "name" in site: - self.created_site_list.append(str(each_type) + ": " + site.get("name")) + self.created_site_list.append(str(each_type) + ": " + str(site.get("name"))) + self.log("Site '{}' created successfully".format(self.created_site_list), "INFO") for site in self.handle_config[each_type]: @@ -1778,7 +1779,7 @@ def get_diff_merged(self, config): self.log(self.msg, "INFO") self.update_not_needed_sites.append(payload_new.get("type") + ": " + site_name_hierarchy) except Exception as e: - self.log("Yaml is not available for bulk: {}".format(e), "ERROR") + self.log("Yaml is not available for bulk: {}".format(str(e)), "ERROR") return self diff --git a/plugins/modules/template_workflow_manager.py b/plugins/modules/template_workflow_manager.py index 2f28205671..b5fc0b1edf 100644 --- a/plugins/modules/template_workflow_manager.py +++ b/plugins/modules/template_workflow_manager.py @@ -14,14 +14,14 @@ module: template_workflow_manager short_description: Resource module for Template functions description: -- Manage operations create, update and delete of the resource Configuration Template. -- API to create a template by project name and template name. -- API to update a template by template name and project name. -- API to delete a template by template name and project name. -- API to export the projects for given projectNames. -- API to export the templates for given templateIds. -- API to manage operation create of the resource Configuration Template Import Project. -- API to manage operation create of the resource Configuration Template Import Template. + - Manage operations create, update and delete of the resource Configuration Template. + - API to create a template by project name and template name. + - API to update a template by template name and project name. + - API to delete a template by template name and project name. + - API to export the projects for given projectNames. + - API to export the templates for given templateIds. + - API to manage operation create of the resource Configuration Template Import Project. + - API to manage operation create of the resource Configuration Template Import Template. version_added: '6.6.0' extends_documentation_fragment: - cisco.dnac.workflow_manager_params @@ -34,15 +34,15 @@ config_verify: description: Set to True to verify the Cisco Catalyst Center after applying the playbook config. type: bool - default: False + default: false state: description: The state of Cisco Catalyst Center after module completion. type: str - choices: [ merged, deleted ] + choices: [merged, deleted] default: merged config: description: - - List of details of templates being managed. + - List of details of templates being managed. type: list elements: dict required: true @@ -59,9 +59,9 @@ type: bool containing_templates: description: - - Refer to a set of templates within the main template to define more complex or modular configurations. - - This is particularly useful in systems that support hierarchical or nested templates. - - Here parent templates may contain child templates to form a complete configuration. + - Refer to a set of templates within the main template to define more complex or modular configurations. + - This is particularly useful in systems that support hierarchical or nested templates. + - Here parent templates may contain child templates to form a complete configuration. suboptions: composite: description: Specifies if the template is composite. @@ -252,8 +252,8 @@ type: str failure_policy: description: - - Define failure policy if template provisioning fails. - - failure_policy will be enabled only when the composite is set to True. + - Define failure policy if template provisioning fails. + - failure_policy will be enabled only when the composite is set to True. choices: - ABORT_TARGET_ON_ERROR type: str @@ -424,21 +424,21 @@ suboptions: do_version: description: - - Determines whether to create a new version of the project with the imported contents. - - If set to true and the project already exists, a new version will be created. - - If false, the operation will fail with a 'Project already exists' error if the project already exists. + - Determines whether to create a new version of the project with the imported contents. + - If set to true and the project already exists, a new version will be created. + - If false, the operation will fail with a 'Project already exists' error if the project already exists. type: bool project_file: description: - - Specifies the path to a JSON file that contains the import project configuration. - - If both 'project_file' and 'payload' are provided, the 'project_file' will be given priority. + - Specifies the path to a JSON file that contains the import project configuration. + - If both 'project_file' and 'payload' are provided, the 'project_file' will be given priority. type: str version_added: 6.17.0 payload: description: - - Directly imports configuration data into the system using the provided payload. - - Offers an alternative to 'project_file' for importing configurations without referencing an external file. - - Ignored if 'project_file' is also provided. + - Directly imports configuration data into the system using the provided payload. + - Offers an alternative to 'project_file' for importing configurations without referencing an external file. + - Ignored if 'project_file' is also provided. type: list elements: dict suboptions: @@ -457,14 +457,14 @@ type: bool template_file: description: - - Specifies the path to a JSON file that contains an import template. - - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. + - Specifies the path to a JSON file that contains an import template. + - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. type: str payload: description: - - The payload parameter is used to directly import configuration data into the system. - - The payload provides an alternative way to import configurations without the need to reference an external file. - - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. + - The payload parameter is used to directly import configuration data into the system. + - The payload provides an alternative way to import configurations without the need to reference an external file. + - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. type: list elements: dict suboptions: @@ -476,9 +476,9 @@ type: bool containing_templates: description: - - Refer to a set of templates within the main template to define more complex or modular configurations. - - This is particularly useful in systems that support hierarchical or nested templates. - - Here parent templates may contain child templates to form a complete configuration. + - Refer to a set of templates within the main template to define more complex or modular configurations. + - This is particularly useful in systems that support hierarchical or nested templates. + - Here parent templates may contain child templates to form a complete configuration. suboptions: composite: description: Specifies if the template is composite. @@ -666,8 +666,8 @@ type: str failure_policy: description: - - Define failure policy if template provisioning fails. - - failure_policy will be enabled only when the composite is set to True. + - Define failure policy if template provisioning fails. + - failure_policy will be enabled only when the composite is set to True. choices: - ABORT_TARGET_ON_ERROR type: str @@ -885,8 +885,8 @@ requirements: -- dnacentersdk >= 2.7.2 -- python >= 3.9 + - dnacentersdk >= 2.7.2 + - python >= 3.9 notes: - SDK Method used are configuration_templates.ConfigurationTemplates.create_template, @@ -3371,7 +3371,7 @@ def delete_project_or_template(self, config, is_delete_project=False): template_params = self.want.get("template_params") params_key = {"template_id": self.have_template.get("id")} deletion_value = "deletes_the_template" - name = "templateName: {0}".format(template_params.get('templateName')) + name = "templateName: {0}".format(template_params.get('name')) response = self.dnac_apply['exec']( family="configuration_templates", @@ -3464,6 +3464,7 @@ def get_diff_deleted(self, config): self.msg = "Project is not deletable" self.status = "failed" return self + self.log("Successfully completed the delete operation for the template {0}".format(templateName), "DEBUG") deploy_temp_details = config.get("deploy_template") if deploy_temp_details: @@ -3474,8 +3475,6 @@ def get_diff_deleted(self, config): ).format(template_name) self.set_operation_result("failed", False, self.msg, "ERROR").check_return_status() - self.msg = "Successfully completed delete state execution" - self.status = "success" return self def verify_diff_merged(self, config): @@ -3570,15 +3569,11 @@ def verify_diff_deleted(self, config): "name", templateName) if template_info: - self.msg = "Configuration Template config is not applied to the Cisco Catalyst Center." - self.status = "failed" + self.log("Configuration Template config is not applied to the Cisco Catalyst Center.", "WARNING") return self - self.log("Successfully validated absence of template in the Catalyst Center.", "INFO") - self.result['response'][0].get("configurationTemplate").get("response").update({"Validation": "Success"}) + self.log("Successfully validated the absence of Template {0} in the Cisco Catalyst Center.".format(templateName), "INFO") - self.msg = "Successfully validated the absence of Template in the Cisco Catalyst Center." - self.status = "success" return self def reset_values(self):