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

Allow an option for strict or loose checking #94

Open
syyna opened this issue Jun 20, 2020 · 0 comments
Open

Allow an option for strict or loose checking #94

syyna opened this issue Jun 20, 2020 · 0 comments

Comments

@syyna
Copy link

syyna commented Jun 20, 2020

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant