cisco.dnac.pnp_device 模块 – PnP 设备资源模块

注意

此模块是 cisco.dnac 集合(版本 6.25.0)的一部分。

如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install cisco.dnac。您需要其他要求才能使用此模块,请参阅 要求 了解详情。

要在 Playbook 中使用它,请指定:cisco.dnac.pnp_device

cisco.dnac 3.1.0 中的新功能

概要

  • 此模块表示模块 pnp_device_v1 的别名

注意

此模块具有相应的 操作插件

要求

执行此模块的主机需要满足以下要求。

  • dnacentersdk >= 2.4.9

  • python >= 3.5

参数

参数

注释

deviceInfo

字典

PnP 设备的 deviceInfo。

description

字符串

描述。

deviceSudiSerialNos

列表 / 元素=字符串

设备 Sudi 序列号。

hostname

字符串

主机名。

macAddress

字符串

Mac 地址。

pid

字符串

Pid。

serialNumber

字符串

序列号。

siteId

字符串

站点 ID。

stack

布尔值

堆栈。

选项

  • false

  • true

stackInfo

字典

PnP 设备的 stackInfo。

isFullRing

布尔值

是否为全环。

选项

  • false

  • true

stackMemberList

列表 / 元素=字典

PnP 设备的 stackMemberList。

hardwareVersion

字符串

硬件版本。

licenseLevel

字符串

许可证级别。

licenseType

字符串

许可证类型。

macAddress

字符串

Mac 地址。

pid

字符串

Pid。

priority

浮点数

优先级。

role

字符串

角色。

serialNumber

字符串

序列号。

softwareVersion

字符串

软件版本。

stackNumber

浮点数

堆栈编号。

state

字符串

状态。

sudiSerialNumber

字符串

Sudi 序列号。

stackRingProtocol

字符串

堆栈环协议。

supportsStackWorkflows

布尔值

支持堆栈工作流程。

选项

  • false

  • true

totalMemberCount

浮点数

成员总数。

validLicenseLevels

列表 / 元素=字符串

有效的许可证级别。

sudiRequired

布尔值

是否需要 Sudi。

选项

  • false

  • true

userMicNumbers

列表 / 元素=字符串

用户 Mic 编号。

userSudiSerialNos

列表 / 元素=字符串

执行 SUDI 授权的安全唯一设备标识符 (SUDI) 序列号列表,如果 sudiRequired 为 true,则为必需。

workflowId

字符串

工作流程 ID。

workflowName

字符串

工作流程名称。

dnac_debug

布尔值

Cisco DNA Center SDK 用于启用调试的标志。

选项

  • false ← (默认)

  • true

dnac_host

字符串 / 必需

Cisco DNA Center 主机名。

dnac_password

字符串

用于验证的 Cisco DNA Center 密码。

dnac_port

整数

Cisco DNA Center 端口。

默认: 443

dnac_username

别名: user

字符串

用于验证的 Cisco DNA Center 用户名。

默认: "admin"

dnac_verify

布尔值

用于启用或禁用 SSL 证书验证的标志。

选项

  • false

  • true ← (默认)

dnac_version

字符串

通知 SDK 要使用的 Cisco DNA Center 版本。

默认: "2.3.7.6"

id

字符串

ID。

validate_response_schema

布尔值

Cisco DNA Center SDK 用于启用针对 JSON 架构验证请求体的标志。

选项

  • false

  • true ← (默认)

说明

注意

  • 使用的 SDK 方法有 device_onboarding_pnp.DeviceOnboardingPnp.add_device、device_onboarding_pnp.DeviceOnboardingPnp.delete_device_by_id_from_pnp_v1、device_onboarding_pnp.DeviceOnboardingPnp.update_device_v1,

  • 使用的路径有 post /dna/intent/api/v1/onboarding/pnp-device、delete /dna/intent/api/v1/onboarding/pnp-device/{id}、put /dna/intent/api/v1/onboarding/pnp-device/{id},

  • 应该注意的是,此模块是 pnp_device_v1 的别名

  • 不支持 check_mode

  • 该插件在控制节点上运行,不使用任何 Ansible 连接插件,而是使用 Cisco DNAC SDK 中的嵌入式连接管理器

  • 以 dnac_ 开头的参数由 Cisco DNAC Python SDK 用于建立连接

另请参阅

另请参阅

Cisco DNA Center 设备入网 (PnP) AddDeviceV1 文档

AddDeviceV1 API 的完整参考。

Cisco DNA Center 设备入网 (PnP) DeleteDeviceByIdFromPnPV1 文档

DeleteDeviceByIdFromPnPV1 API 的完整参考。

Cisco DNA Center 设备入网 (PnP) UpdateDeviceV1 文档

UpdateDeviceV1 API 的完整参考。

示例

- name: Create
  cisco.dnac.pnp_device:
    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}}"
    state: present
    deviceInfo:
      description: string
      deviceSudiSerialNos:
      - string
      hostname: string
      macAddress: string
      pid: string
      serialNumber: string
      siteId: string
      stack: true
      stackInfo:
        isFullRing: true
        stackMemberList:
        - hardwareVersion: string
          licenseLevel: string
          licenseType: string
          macAddress: string
          pid: string
          priority: 0
          role: string
          serialNumber: string
          softwareVersion: string
          stackNumber: 0
          state: string
          sudiSerialNumber: string
        stackRingProtocol: string
        supportsStackWorkflows: true
        totalMemberCount: 0
        validLicenseLevels:
        - string
      sudiRequired: true
      userMicNumbers:
      - string
      userSudiSerialNos:
      - string
      workflowId: string
      workflowName: string

- name: Update by id
  cisco.dnac.pnp_device:
    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}}"
    state: present
    deviceInfo:
      hostname: string
      pid: string
      serialNumber: string
      stack: true
      sudiRequired: true
      userSudiSerialNos:
      - string
    id: string

- name: Delete by id
  cisco.dnac.pnp_device:
    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}}"
    state: absent
    id: string

返回值

常见的返回值记录在此处,以下是此模块独有的字段

描述

dnac_response

字典

包含 Cisco DNAC Python SDK 返回的响应的字典或列表

已返回: 始终

Sample: {"_id": "string", "dayZeroConfig": {"config": "string"}, "dayZeroConfigPreview": {}, "deviceInfo": {"aaaCredentials": {"password": "string", "username": "string"}, "addedOn": 0, "addnMacAddrs": ["string"], "agentType": "string", "authStatus": "string", "authenticatedMicNumber": "string", "authenticatedSudiSerialNo": "string", "capabilitiesSupported": ["string"], "cmState": "string", "description": "string", "deviceSudiSerialNos": ["string"], "deviceType": "string", "featuresSupported": ["string"], "fileSystemList": [{"freespace": 0, "name": "string", "readable": true, "size": 0, "type": "string", "writeable": true}], "firstContact": 0, "hostname": "string", "httpHeaders": [{"key": "string", "value": "string"}], "imageFile": "string", "imageVersion": "string", "ipInterfaces": [{"ipv4Address": {}, "ipv6AddressList": [{}], "macAddress": "string", "name": "string", "status": "string"}], "lastContact": 0, "lastSyncTime": 0, "lastUpdateOn": 0, "location": {"address": "string", "altitude": "string", "latitude": "string", "longitude": "string", "siteId": "string"}, "macAddress": "string", "mode": "string", "name": "string", "neighborLinks": [{"localInterfaceName": "string", "localMacAddress": "string", "localShortInterfaceName": "string", "remoteDeviceName": "string", "remoteInterfaceName": "string", "remoteMacAddress": "string", "remotePlatform": "string", "remoteShortInterfaceName": "string", "remoteVersion": "string"}], "onbState": "string", "pid": "string", "pnpProfileList": [{"createdBy": "string", "discoveryCreated": true, "primaryEndpoint": {"certificate": "string", "fqdn": "string", "ipv4Address": {}, "ipv6Address": {}, "port": 0, "protocol": "string"}, "profileName": "string", "secondaryEndpoint": {"certificate": "string", "fqdn": "string", "ipv4Address": {}, "ipv6Address": {}, "port": 0, "protocol": "string"}}], "populateInventory": true, "preWorkflowCliOuputs": [{"cli": "string", "cliOutput": "string"}], "projectId": "string", "projectName": "string", "reloadRequested": true, "serialNumber": "string", "siteId": "string", "siteName": "string", "smartAccountId": "string", "source": "string", "stack": true, "stackInfo": {"isFullRing": true, "stackMemberList": [{"hardwareVersion": "string", "licenseLevel": "string", "licenseType": "string", "macAddress": "string", "pid": "string", "priority": 0, "role": "string", "serialNumber": "string", "softwareVersion": "string", "stackNumber": 0, "state": "string", "sudiSerialNumber": "string"}], "stackRingProtocol": "string", "supportsStackWorkflows": true, "totalMemberCount": 0, "validLicenseLevels": ["string"]}, "state": "string", "sudiRequired": true, "tags": {}, "userMicNumbers": ["string"], "userSudiSerialNos": ["string"], "virtualAccountId": "string", "workflowId": "string", "workflowName": "string"}, "runSummaryList": [{"details": "string", "errorFlag": true, "historyTaskInfo": {"addnDetails": [{"key": "string", "value": "string"}], "name": "string", "timeTaken": 0, "type": "string", "workItemList": [{"command": "string", "endTime": 0, "outputStr": "string", "startTime": 0, "state": "string", "timeTaken": 0}]}, "timestamp": 0}], "systemResetWorkflow": {"_id": "string", "addToInventory": true, "addedOn": 0, "configId": "string", "currTaskIdx": 0, "description": "string", "endTime": 0, "execTime": 0, "imageId": "string", "instanceType": "string", "lastupdateOn": 0, "name": "string", "startTime": 0, "state": "string", "tasks": [{"currWorkItemIdx": 0, "endTime": 0, "name": "string", "startTime": 0, "state": "string", "taskSeqNo": 0, "timeTaken": 0, "type": "string", "workItemList": [{"command": "string", "endTime": 0, "outputStr": "string", "startTime": 0, "state": "string", "timeTaken": 0}]}], "tenantId": "string", "type": "string", "useState": "string", "version": 0}, "systemWorkflow": {"_id": "string", "addToInventory": true, "addedOn": 0, "configId": "string", "currTaskIdx": 0, "description": "string", "endTime": 0, "execTime": 0, "imageId": "string", "instanceType": "string", "lastupdateOn": 0, "name": "string", "startTime": 0, "state": "string", "tasks": [{"currWorkItemIdx": 0, "endTime": 0, "name": "string", "startTime": 0, "state": "string", "taskSeqNo": 0, "timeTaken": 0, "type": "string", "workItemList": [{"command": "string", "endTime": 0, "outputStr": "string", "startTime": 0, "state": "string", "timeTaken": 0}]}], "tenantId": "string", "type": "string", "useState": "string", "version": 0}, "tenantId": "string", "version": 0, "workflow": {"_id": "string", "addToInventory": true, "addedOn": 0, "configId": "string", "currTaskIdx": 0, "description": "string", "endTime": 0, "execTime": 0, "imageId": "string", "instanceType": "string", "lastupdateOn": 0, "name": "string", "startTime": 0, "state": "string", "tasks": [{"currWorkItemIdx": 0, "endTime": 0, "name": "string", "startTime": 0, "state": "string", "taskSeqNo": 0, "timeTaken": 0, "type": "string", "workItemList": [{"command": "string", "endTime": 0, "outputStr": "string", "startTime": 0, "state": "string", "timeTaken": 0}]}], "tenantId": "string", "type": "string", "useState": "string", "version": 0}, "workflowParameters": {"configList": [{"configId": "string", "configParameters": [{"key": "string", "value": "string"}]}], "licenseLevel": "string", "licenseType": "string", "topOfStackSerialNumber": "string"}}

作者

  • Rafael Campos (@racampos)