blob: 99a7c6f8612b32e8d2c53f5712df5d814b2d8f7c [file] [log] [blame]
Zack Williams142f2b52020-11-22 19:35:44 -07001---
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 Williams8296e472021-03-23 21:13:07 -070010
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.