Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Allow an option for strict or loose checking #94

@syyna

Description

@syyna

In most production environments, there will be some config drift that aren't easily fixable, or in some network OSes, they sometimes change what would be an ordered list into an unordered list. While ordered lists are critical for things like ACLs, they can be seen as minor features for things like DNS or NTP servers. As such, an option to allow for loose ordering can be useful so we don't get false positives like this:

ok: [localhost] => {
    "msg": {
        "changed": false,
        "failed": true,
        "msg": "Validation failed for the following nodes: ['veos1'].",
        "result": {
            "veos1": {
                "NTP.NTP_Servers": {
                    "actual": [
                        "10.0.0.1",
                        "time-a-g.nist.gov",
                        "time-e-b.nist.gov"
                    ],
                    "expected": [
                        "time-a-g.nist.gov",
                        "10.0.0.1",
                        "time-e-b.nist.gov"
                    ]
                }
            }
        },
        "summary": "Validation failed for the following nodes: ['veos1']."
    }
}

I see something like this being definied in the category of a validation yml file like:

nodes:
  veos1:
    DNS:
      **non-strict**
      DNS_Servers:
        - 192.168.49.20
        - 8.8.8.8
    NTP:
      NTP_Servers:
        **non-strict**
        - 10.0.0.1
        - time-a-g.nist.gov
        - time-e-b.nist.gov

version: batfish_v0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions