Zack Williams | 142f2b5 | 2020-11-22 19:35:44 -0700 | [diff] [blame] | 1 | --- |
| 2 | # unbound molecule/default/verify.yml |
| 3 | # |
| 4 | # SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | |
| 7 | - name: Verify |
| 8 | hosts: all |
| 9 | tasks: |
Zack Williams | 8296e47 | 2021-03-23 21:13:07 -0700 | [diff] [blame^] | 10 | |
| 11 | - name: Check for A record |
| 12 | command: # noqa 301 |
| 13 | cmd: "dig +short gw.example.com @{{ ansible_default_ipv4.address }}" |
| 14 | register: a_dig |
| 15 | failed_when: "'192.168.1.1' not in a_dig.stdout" |
| 16 | |
| 17 | - name: Check for NS record |
| 18 | command: # noqa 301 |
| 19 | cmd: "dig ns +short example.com @{{ ansible_default_ipv4.address }}" |
| 20 | register: ns_dig |
| 21 | failed_when: "'gw.example.com.' not in ns_dig.stdout" |
| 22 | |
| 23 | - name: Check for CNAME record |
| 24 | command: # noqa 301 |
| 25 | cmd: "dig +short lpr.example.com @{{ ansible_default_ipv4.address }}" |
| 26 | register: cn_dig |
| 27 | failed_when: "'printer.example.com.\n192.168.1.4' not in cn_dig.stdout" |
| 28 | |
| 29 | - name: Check for reverse IP lookup |
| 30 | command: # noqa 301 |
| 31 | cmd: "dig -x {{ item.key }} @{{ ansible_default_ipv4.address }}" |
| 32 | register: rip_dig |
| 33 | failed_when: "item.value not in rip_dig.stdout" |
| 34 | with_dict: |
| 35 | 192.168.1.1: gw.example.com. |
| 36 | 192.168.1.2: host1.example.com. |
| 37 | 192.168.1.3: host2.example.com. |
| 38 | 192.168.1.4: printer.example.com. |