---
- debug: msg="START connection={{ ansible_connection }}/set_state_absent.yaml"
- debug: msg="Using provider={{ connection.transport }}"
  when: ansible_connection == "local"

- name: setup
  nxos_config:
    lines:
      - interface Loopback1
    provider: "{{ connection }}"

- name: set state=absent
  nxos_interface:
    interface: Loopback1
    provider: "{{ connection }}"
    state: absent
  register: result

- assert:
    that:
      - "result.changed == true"

- name: verify state=absent
  nxos_interface:
    interface: Loopback1
    provider: "{{ connection }}"
    state: absent
  register: result

- assert:
    that:
      - "result.changed == false"

- debug: msg="END connection={{ ansible_connection }}/set_state_absent.yaml"
