blob: d7cb7db30637de3bdf4fdfaea4cb3539d7139269 [file] [log] [blame]
Zack Williams13644cc2020-08-30 15:16:43 -07001---
2# nsd 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:
10
11 # NOTE: Tests do not use the ansible dig lookup, because that executes on
12 # the host running ansible-playbook, not the target host.
13
14 # Lint flags the checks as they execute every time, skip this with 'noqa 301'
15
16 - name: Check for A record
Zack Williams1a15bbb2022-09-05 08:53:52 -070017 command: # noqa 301 no-tabs
Zack Williams13644cc2020-08-30 15:16:43 -070018 cmd: "dig gw.example.com @127.0.0.1"
19 register: a_dig
Zack Williamsda1625e2020-11-25 12:11:19 -070020 failed_when: "'gw.example.com.\t\t3600\tIN\tA\t10.0.0.1' not in a_dig.stdout"
Zack Williams13644cc2020-08-30 15:16:43 -070021
22 - name: Check for NS record
23 command: # noqa 301
Zack Williamsb7f2ab42021-03-15 22:26:41 -070024 cmd: "dig ns +short example.com @127.0.0.1"
Zack Williams13644cc2020-08-30 15:16:43 -070025 register: ns_dig
Zack Williamsb7f2ab42021-03-15 22:26:41 -070026 failed_when: "'gw.example.com.' not in ns_dig.stdout"
Zack Williams13644cc2020-08-30 15:16:43 -070027
28 - name: Check for CNAME record
Zack Williams1a15bbb2022-09-05 08:53:52 -070029 command: # noqa 301 no-tabs
Zack Williams13644cc2020-08-30 15:16:43 -070030 cmd: "dig lpr.example.com @127.0.0.1"
31 register: cn_dig
32 failed_when: "'lpr.example.com.\t3600\tIN\tCNAME\tprinter.example.com.' not in cn_dig.stdout"
Zack Williamsb7f2ab42021-03-15 22:26:41 -070033
34 - name: Check for reverse IP lookup
35 command: # noqa 301
36 cmd: "dig -x {{ item.key }} @127.0.0.1"
37 register: rip_dig
38 failed_when: "item.value not in rip_dig.stdout"
39 with_dict:
40 10.0.0.1: gw.example.com.
41 10.0.0.2: host1.example.com.
42 10.0.0.3: host2.example.com.
43 10.0.0.4: printer1.example.com.
44 10.0.10.1: gw2.example.org.