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

- name: setup
  eos_config:
    lines: no ip domain-name
    match: none
  become: yes

- name: configure domain_name
  eos_system:
    domain_name: eng.ansible.com
  become: yes
  register: result

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

- name: verify domain_name
  eos_system:
    domain_name: eng.ansible.com
  become: yes
  register: result

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

- name: teardown
  eos_config:
    lines: no ip domain-name
    match: none
  become: yes

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