summaryrefslogtreecommitdiffstats
path: root/ansible_collections/cisco/dnac/playbooks/device_provision_workflow.yml
blob: 61c23937a8cbfaf2ae509237ef7ffce08115dee9 (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
---
- name: Provision and Re-provision wired and wireless devices
  hosts: localhost
  connection: local
  gather_facts: no

  vars_files:
    - "{{ CLUSTERFILE }}"

  vars:
    dnac_login: &dnac_login
      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 }}"

  tasks:
    - name: Assign a wired device to a site
      cisco.dnac.provision_workflow_manager:
        <<: *dnac_login
        dnac_log: True
        state: merged
        config_verify: True
        config:
          - site_name_hierarchy: Global/USA/New York/NY_BLD1

            management_ip_address: 204.192.3.40
            provisioning: false

    - name: Provision a wired device to a site
      cisco.dnac.provision_workflow_manager:
        <<: *dnac_login
        dnac_log: True
        dnac_log_level: DEBUG
        state: merged
        config_verify: True
        config:
          - site_name_hierarchy: Global/USA/SAN JOSE/BLD23/BLD20_FLOOR2
            management_ip_address: 204.192.3.40

    - name: Unprovision a wired device from a site
      cisco.dnac.provision_workflow_manager:
        <<: *dnac_login
        dnac_log: True
        state: deleted
        config:
          - management_ip_address: 204.1.2.2

    - name: Provision a wireless device to a site
      cisco.dnac.provision_workflow_manager:
        <<: *dnac_login
        dnac_log: True
        dnac_log_level: DEBUG
        state: merged
        config_verify: True
        config:
          - site_name_hierarchy: Global/USA/RTP/BLD11
            management_ip_address: 204.192.12.201
            managed_ap_locations:
              - Global/USA/RTP/BLD11/BLD11_FLOOR1