---
- name: Provision and Re-provision wired and wireless devices
  hosts: localhost
  connection: local
  gather_facts: false  # This space must be "no". It was set to false due to formatting errors.but the correct value is "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 }}"

  tasks:
    - name: Provision a wired device to a site
      cisco.dnac.provision_intent:
        <<: *dnac_login
        dnac_log: true
        state: merged
        config:
          - site_name: Global/USA/San Francisco/BGL_18
            management_ip_address: 204.1.2.2


    - name: Unprovision a wired device to a site
      cisco.dnac.provision_intent:
        <<: *dnac_login
        dnac_log: true
        state: deleted
        config:
          - management_ip_address: 204.1.2.2
