---
# run tests against nameservers

- name: test local access
  command: dig @{{item}} google.ca +tcp
  with_items:
    - "{{inventory_hostname}}"
    - "{{inventory_hostname}}.xai-corp.net"
    - "localhost"
    - "127.0.0.1"
  changed_when: false

- name: test dig from {{ansible_play_hosts_all}} names
  command: dig @{{item}} google.ca +tcp
  with_items: "{{ansible_play_hosts_all}}"
  changed_when: false

- name: test dig from {{ansible_play_hosts_all}}.xai-corp.net
  command: dig @{{item}}.xai-corp.net google.ca +tcp
  with_items: "{{ansible_play_hosts_all}}"
  changed_when: false
