cisco.dnac.pnp_intent module – Resource module for Site and PnP related functions
Note
This module is part of the cisco.dnac collection (version 6.22.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install cisco.dnac
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: cisco.dnac.pnp_intent
.
New in cisco.dnac 6.6.0
Synopsis
Manage operations add device, claim device and unclaim device of Onboarding Configuration(PnP) resource
API to add device to pnp inventory and claim it to a site.
API to delete device from the pnp inventory.
API to reset the device from errored state.
Requirements
The below requirements are needed on the host that executes this module.
dnacentersdk == 2.6.10
python >= 3.9
Parameters
Parameter |
Comments |
---|---|
List of details of device being managed. |
|
Provides the device-specific information required for adding devices to the PnP database that are not already present. For adding a single device, the list should contain exactly one set of device information. If a site name is also provided, the device can be claimed immediately after being added. For bulk import, the list must contain information for more than one device. Bulk import is intended solely for adding devices; claiming must be performed with separate tasks or configurations. |
|
Defines the desired hostname for the PnP device after it has been claimed. The hostname can only be assigned or changed during the claim process, not during bulk or single device additions. |
|
Sudi Authentication requiremnet’s flag. Choices:
|
|
Pnp Device’s pid. |
|
Pnp Device’s serial_number. |
|
Represents the onboarding state of the PnP device. Possible values are ‘Unclaimed’, ‘Claimed’, or ‘Provisioned’. |
|
Gateway IP address of the Wireless Controller for getting pinged |
|
Is the image to be condifgured tagged as golden image Choices:
|
|
Name of image to be configured on the device |
|
Specifies the interface name utilized for Plug and Play (PnP) by the Wireless Controller. Ensure this interface is pre-configured on the Controller prior to device claiming. |
|
Specifies the device type for the Plug and Play (PnP) device. - Options include ‘Default’, ‘CatalystWLC’, ‘AccessPoint’, or ‘StackSwitch’. - ‘Default’ is applicable to switches and routers. - ‘CatalystWLC’ should be selected for 9800 series wireless controllers. - ‘AccessPoint’ is used when claiming an access point. - ‘StackSwitch’ should be chosen for a group of switches that operate as a single switch, typically used in the access layer. Choices:
|
|
Name of the project under which the template is present Default: |
|
Radio Frequecy (RF) profile of the AP being claimed. RF Profiles allow you to tune groups of APs that share a common coverage zone together. They selectively change how Radio Resource Management will operate the APs within that coverage zone. HIGH RF profile allows you to use more power and allows to join AP with the client in an easier fashion. TYPICAL RF profile is a blend of moderate power and moderate visibility to the client. LOW RF profile allows you to consume lesser power and has least visibility to the client. Choices:
|
|
Name of the site for which device will be claimed. |
|
Management IP address of the Wireless Controller |
|
Subnet Mask of the Management IP address of the Wireless Controller |
|
Name of template to be configured on the device. Supported for EWLC from Cisco Catalyst Center release version 2.3.7.x onwards. |
|
Parameter values for the parameterised templates. Each varibale has a value that needs to be passed as key-value pair in the dictionary. We can pass values as variable_name:variable_value. Supported for EWLC from Cisco Catalyst Center release version 2.3.7.x onwards. |
|
Vlan Id allocated for claimimg of Wireless Controller |
|
Set to True to verify the Cisco Catalyst Center config after applying the playbook config. Choices:
|
|
Defines the timeout in seconds for API calls to retrieve task details. If the task details are not received within this period, the process will end, and a timeout notification will be logged. Default: |
|
Flag for Cisco DNA Center SDK to enable debugging. Choices:
|
|
The Cisco DNA Center hostname. |
|
Flag to enable/disable playbook execution logging. When true and dnac_log_file_path is provided, - Create the log file at the execution location with the specified name. When true and dnac_log_file_path is not provided, - Create the log file at the execution location with the name ‘dnac.log’. When false, - Logging is disabled. If the log file doesn’t exist, - It is created in append or write mode based on the “dnac_log_append” flag. If the log file exists, - It is overwritten or appended based on the “dnac_log_append” flag. Choices:
|
|
Determines the mode of the file. Set to True for ‘append’ mode. Set to False for ‘write’ mode. Choices:
|
|
Governs logging. Logs are recorded if dnac_log is True. If path is not specified, - When ‘dnac_log_append’ is True, ‘dnac.log’ is generated in the current Ansible directory; logs are appended. - When ‘dnac_log_append’ is False, ‘dnac.log’ is generated; logs are overwritten. If path is specified, - When ‘dnac_log_append’ is True, the file opens in append mode. - When ‘dnac_log_append’ is False, the file opens in write (w) mode. - In shared file scenarios, without append mode, content is overwritten after each module execution. - For a shared log file, set append to False for the 1st module (to overwrite); for subsequent modules, set append to True. Default: |
|
Sets the threshold for log level. Messages with a level equal to or higher than this will be logged. Levels are listed in order of severity [CRITICAL, ERROR, WARNING, INFO, DEBUG]. CRITICAL indicates serious errors halting the program. Displays only CRITICAL messages. ERROR indicates problems preventing a function. Displays ERROR and CRITICAL messages. WARNING indicates potential future issues. Displays WARNING, ERROR, CRITICAL messages. INFO tracks normal operation. Displays INFO, WARNING, ERROR, CRITICAL messages. DEBUG provides detailed diagnostic info. Displays all log messages. Default: |
|
The Cisco DNA Center password to authenticate. |
|
The Cisco DNA Center port. Default: |
|
Specifies the interval in seconds between successive calls to the API to retrieve task details. Default: |
|
The Cisco DNA Center username to authenticate. Default: |
|
Flag to enable or disable SSL certificate verification. Choices:
|
|
Informs the SDK which version of Cisco DNA Center to use. Default: |
|
The state of Cisco Catalyst Center after module completion. Choices:
|
|
Flag for Cisco DNA Center SDK to enable the validation of request bodies against a JSON schema. Choices:
|
Notes
Note
SDK Method used are device_onboarding_pnp.DeviceOnboardingPnp.add_device, device_onboarding_pnp.DeviceOnboardingPnp.get_device_list, device_onboarding_pnp.DeviceOnboardingPnp.claim_a_device_to_a_site, device_onboarding_pnp.DeviceOnboardingPnp.delete_device_by_id_from_pnp, device_onboarding_pnp.DeviceOnboardingPnp.get_device_count, device_onboarding_pnp.DeviceOnboardingPnp.get_device_by_id, device_onboarding_pnp.DeviceOnboardingPnp.update_device, sites.Sites.get_site, software_image_management_swim.SoftwareImageManagementSwim.get_software_image_details, configuration_templates.ConfigurationTemplates.gets_the_templates_available
Paths used are post /dna/intent/api/v1/onboarding/pnp-device post /dna/intent/api/v1/onboarding/pnp-device/site-claim post /dna/intent/api/v1/onboarding/pnp-device/{id} get /dna/intent/api/v1/onboarding/pnp-device/count get /dna/intent/api/v1/onboarding/pnp-device put /onboarding/pnp-device/${id} get /dna/intent/api/v1/site get /dna/intent/api/v1/image/importation get /dna/intent/api/v1/template-programmer/template
Does not support
check_mode
The plugin runs on the control node and does not use any ansible connection plugins, but instead the embedded connection manager from Cisco DNAC SDK
The parameters starting with dnac_ are used by the Cisco DNAC Python SDK to establish the connection
Examples
- name: Import multiple switches in bulk only
cisco.dnac.pnp_intent:
dnac_host: "{{dnac_host}}"
dnac_username: "{{dnac_username}}"
dnac_password: "{{dnac_password}}"
dnac_verify: "{{dnac_verify}}"
dnac_port: "{{dnac_port}}"
dnac_version: "{{dnac_version}}"
dnac_debug: "{{dnac_debug}}"
dnac_log_level: "{{dnac_log_level}}"
dnac_log: True
state: merged
config_verify: True
config:
- device_info:
- serial_number: QD2425L8M7
state: Unclaimed
pid: c9300-24P
is_sudi_required: False
- serial_number: QTC2320E0H9
state: Unclaimed
pid: c9300-24P
hostname: Test-123
- serial_number: ETC2320E0HB
state: Unclaimed
pid: c9300-24P
- name: Add a new EWLC and claim it
cisco.dnac.pnp_intent:
dnac_host: "{{dnac_host}}"
dnac_username: "{{dnac_username}}"
dnac_password: "{{dnac_password}}"
dnac_verify: "{{dnac_verify}}"
dnac_port: "{{dnac_port}}"
dnac_version: "{{dnac_version}}"
dnac_debug: "{{dnac_debug}}"
dnac_log_level: "{{dnac_log_level}}"
dnac_log: True
state: merged
config_verify: True
config:
- device_info:
- serial_number: FOX2639PAY7
hostname: New_WLC
state: Unclaimed
pid: C9800-CL-K9
site_name: Global/USA/San Francisco/BGL_18
template_name: Ansible_PNP_WLC
template_params:
hostname: IAC-EWLC-Claimed
project_name: Onboarding Configuration
image_name: C9800-40-universalk9_wlc.17.12.01.SPA.bin
golden_image: true
pnp_type: CatalystWLC
static_ip: 204.192.101.10
subnet_mask: 255.255.255.0
gateway: 204.192.101.1
vlan_id: 1101
ip_interface_name: TenGigabitEthernet0/0/0
- name: Claim a pre-added switch, apply a template, and perform an image upgrade for a specific site
cisco.dnac.pnp_intent:
dnac_host: "{{dnac_host}}"
dnac_username: "{{dnac_username}}"
dnac_password: "{{dnac_password}}"
dnac_verify: "{{dnac_verify}}"
dnac_port: "{{dnac_port}}"
dnac_version: "{{dnac_version}}"
dnac_debug: "{{dnac_debug}}"
dnac_log_level: "{{dnac_log_level}}"
dnac_log: True
state: merged
config_verify: True
config:
- device_info:
- serial_number: FJC271924EQ
hostname: Switch
state: Unclaimed
pid: C9300-48UXM
site_name: Global/USA/San Francisco/BGL_18
template_name: "Ansible_PNP_Switch"
image_name: cat9k_iosxe_npe.17.03.07.SPA.bin
project_name: Onboarding Configuration
template_params:
hostname: SJC-Switch-1
interface: TwoGigabitEthernet1/0/2
- name: Remove multiple devices from the PnP dashboard safely (ignores non-existent devices)
cisco.dnac.pnp_intent:
dnac_host: "{{dnac_host}}"
dnac_username: "{{dnac_username}}"
dnac_password: "{{dnac_password}}"
dnac_verify: "{{dnac_verify}}"
dnac_port: "{{dnac_port}}"
dnac_version: "{{dnac_version}}"
dnac_debug: "{{dnac_debug}}"
dnac_log_level: "{{dnac_log_level}}"
dnac_log: True
state: deleted
config_verify: True
config:
- device_info:
- serial_number: QD2425L8M7
- serial_number: FTC2320E0HA
- serial_number: FKC2310E0HB
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A dictionary with the response returned by the Cisco Catalyst Center Python SDK Returned: always Sample: |
|
A list with the response returned by the Cisco Catalyst Center Python SDK Returned: always Sample: |
|
A string with the response returned by the Cisco Catalyst Center Python SDK Returned: always Sample: |
Authors
Abinash Mishra (@abimishr) Madhan Sankaranarayanan (@madhansansel) Rishita Chowdhary (@rishitachowdhary)