---
- name: Network Device
  hosts: ise_servers
  gather_facts: false
  tasks:
    # - name: Get all network devices
    #   cisco.ise.network_device_info:
    #     ise_hostname: "{{ ise_hostname }}"
    #     ise_username: "{{ ise_username }}"
    #     ise_password: "{{ ise_password }}"
    #     ise_verify: "{{ ise_verify }}"
    #   register: result

    # - name: Get a network device by id
    #   cisco.ise.network_device_info:
    #     ise_hostname: "{{ ise_hostname }}"
    #     ise_username: "{{ ise_username }}"
    #     ise_password: "{{ ise_password }}"
    #     ise_verify: "{{ ise_verify }}"
    #     id: 0667bc80-78a9-11eb-b987-005056aba98b
    #   register: result

    # - name: Get a network device by name
    #   cisco.ise.network_device_info:
    #     ise_hostname: "{{ ise_hostname }}"
    #     ise_username: "{{ ise_username }}"
    #     ise_password: "{{ ise_password }}"
    #     ise_verify: "{{ ise_verify }}"
    #     name: Test_Device_7
    #   register: result

    - name: Create or update a network device
      cisco.ise.network_device:
        ise_hostname: "{{ ise_hostname }}"
        ise_username: "{{ ise_username }}"
        ise_password: "{{ ise_password }}"
        ise_verify: "{{ ise_verify }}"
        state: present
        name: ISE_EST_Local_Host_5
        NetworkDeviceIPList:
          - ipaddress: 127.16.0.1
            mask: 32
      register: result

  # - name: Delete a network device by id
  #   cisco.ise.network_device:
  #     ise_hostname: "{{ ise_hostname }}"
  #     ise_username: "{{ ise_username }}"
  #     ise_password: "{{ ise_password }}"
  #     ise_verify: "{{ ise_verify }}"
  #     state: absent
  #     id: 970f2cb0-aa03-11eb-95af-f263cf05f605
  #   register: result

  # - name: Delete a network device by name
  #   cisco.ise.network_device:
  #     ise_hostname: "{{ ise_hostname }}"
  #     ise_username: "{{ ise_username }}"
  #     ise_password: "{{ ise_password }}"
  #     ise_verify: "{{ ise_verify }}"
  #     state: absent
  #     name: Test_Device_7
  #   register: result
