summaryrefslogtreecommitdiffstats
path: root/ansible_collections/cisco/dnac/playbooks/pnp_device.yml
blob: cfd8bc418c3602ee0fe42ac12f9fb2fe68b1594f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
- hosts: dnac_servers
  vars_files:
    - credentials.yml
  gather_facts: false
  tasks:
    # - 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: 5f96f83854ee220008a9c456
    #   register: pnp_device_delete_result

    # - name: Show deleted pnp_device
    #   debug:
    #     msg: "{{ pnp_device_delete_result }}"
    #   when:
    #     - pnp_device_delete_result is defined

    - name: Adds or Updates a device to the PnP database
      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
        version: 2
        deviceInfo:
          serialNumber: FOCTEST2
          name: FOCTEST2
          state: Unclaimed
          # onbState: Not Contacted
          # cmState: Not Contacted
          location: {}
          source: User
          reloadRequested: false
          aaaCredentials:
            username: ""
            password: ""
          populateInventory: false
          poeSupported: false
          capwapBackOff: false
          redirectionState: NONE
          dayN: false
          dayNClaimOperation: NO_OP
          tlsState: NO_OP
          reProvision: false
          authOperation: AUTHORIZATION_NOT_REQUIRED
          stack: false
          sudiRequired: false
          validActions:
            editSUDI: true
            editWfParams: true
            delete: true
            claim: true
            unclaim: true
            reset: false
            authorize: false
            resetMsg: This device is not in Error state. Only Error devices may be Reset.
            authorizeMsg: This Device is not in PendingAuthorization state.
        workflowParameters: {}
        tenantId: 5cdc6c45a8405f00c80c6ba3
        id: 610ab95c07a77b0fbec39f22
      register: pnp_device_result

    - name: Show new pnp_device
      ansible.builtin.debug:
        msg: "{{ pnp_device_result }}"
      when:
        - pnp_device_result is defined