| --- |
| # unbound molecule/default/verify.yml |
| # |
| # SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| # SPDX-License-Identifier: Apache-2.0 |
| |
| - name: Verify |
| hosts: all |
| tasks: |
| |
| - name: Check for A record |
| command: # noqa 301 |
| cmd: "dig +short gw.example.com @{{ ansible_default_ipv4.address }}" |
| register: a_dig |
| failed_when: "'192.168.1.1' not in a_dig.stdout" |
| |
| - name: Check for NS record |
| command: # noqa 301 |
| cmd: "dig ns +short example.com @{{ ansible_default_ipv4.address }}" |
| register: ns_dig |
| failed_when: "'gw.example.com.' not in ns_dig.stdout" |
| |
| - name: Check for CNAME record |
| command: # noqa 301 |
| cmd: "dig +short lpr.example.com @{{ ansible_default_ipv4.address }}" |
| register: cn_dig |
| failed_when: "'printer.example.com.\n192.168.1.4' not in cn_dig.stdout" |
| |
| - name: Check for reverse IP lookup |
| command: # noqa 301 |
| cmd: "dig -x {{ item.key }} @{{ ansible_default_ipv4.address }}" |
| register: rip_dig |
| failed_when: "item.value not in rip_dig.stdout" |
| with_dict: |
| 192.168.1.1: gw.example.com. |
| 192.168.1.2: host1.example.com. |
| 192.168.1.3: host2.example.com. |
| 192.168.1.4: printer.example.com. |