| --- |
| # nsd molecule/default/verify.yml |
| # |
| # SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| # SPDX-License-Identifier: Apache-2.0 |
| |
| - name: Verify |
| hosts: all |
| tasks: |
| |
| # NOTE: Tests do not use the ansible dig lookup, because that executes on |
| # the host running ansible-playbook, not the target host. |
| |
| # Lint flags the checks as they execute every time, skip this with 'noqa 301' |
| |
| - name: Check for A record |
| command: # noqa 301 no-tabs |
| cmd: "dig gw.example.com @127.0.0.1" |
| register: a_dig |
| failed_when: "'gw.example.com.\t\t3600\tIN\tA\t10.0.0.1' not in a_dig.stdout" |
| |
| - name: Check for NS record |
| command: # noqa 301 |
| cmd: "dig ns +short example.com @127.0.0.1" |
| register: ns_dig |
| failed_when: "'gw.example.com.' not in ns_dig.stdout" |
| |
| - name: Check for CNAME record |
| command: # noqa 301 no-tabs |
| cmd: "dig lpr.example.com @127.0.0.1" |
| register: cn_dig |
| failed_when: "'lpr.example.com.\t3600\tIN\tCNAME\tprinter.example.com.' not in cn_dig.stdout" |
| |
| - name: Check for reverse IP lookup |
| command: # noqa 301 |
| cmd: "dig -x {{ item.key }} @127.0.0.1" |
| register: rip_dig |
| failed_when: "item.value not in rip_dig.stdout" |
| with_dict: |
| 10.0.0.1: gw.example.com. |
| 10.0.0.2: host1.example.com. |
| 10.0.0.3: host2.example.com. |
| 10.0.0.4: printer1.example.com. |
| 10.0.10.1: gw2.example.org. |