---
- debug: msg="START cli/set_lookup_source.yaml on connection={{ ansible_connection }}"

- name: setup
  iosxr_config:
    lines: no domain lookup source-interface Loopback10
    match: none
    provider: "{{ cli }}"

- name: configure lookup_source
  iosxr_system:
    lookup_source: Loopback10
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - result.changed == true
      - "'domain lookup source-interface Loopback10' in result.commands"

- name: verify lookup_source
  iosxr_system:
    lookup_source: Loopback10
    provider: "{{ cli }}"
  register: result

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

- name: teardown
  iosxr_config:
    lines:
      - no domain lookup source-interface Loopback10
    match: none
    provider: "{{ cli }}"

- debug: msg="END cli/set_lookup_source.yaml on connection={{ ansible_connection }}"
