-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #767 from nautobot/release-2.1
Release 2.1
- Loading branch information
Showing
17 changed files
with
301 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
# v2.1 Release Notes | ||
|
||
- Added support for XML Compliance. | ||
- Hide Compliance tab if no compliance result exists. | ||
|
||
|
||
### Added | ||
|
||
- [#1501](https://github.com/nautobot/nautobot-app-golden-config/issues/1501) - Add Support for XML Compliance | ||
|
||
### Fixed | ||
|
||
- [#723](https://github.com/nautobot/nautobot-app-golden-config/issues/723) - Hide compliance tab in device view if no compliance results exist. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# E3031 Details | ||
|
||
## Message emitted: | ||
|
||
`E3031: Invalid XPath expression.` | ||
|
||
## Description: | ||
|
||
This error occurs when an invalid XPath expression is used in a Compliance Job, causing a `NornirNautobotException` to be raised. | ||
|
||
## Troubleshooting: | ||
|
||
Review the exception message and worker logs to determine the cause of the failure. | ||
|
||
## Recommendation: | ||
|
||
Ensure that you are using a valid XPath expression in the "Config to Match" section of your Compliance Rule. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Navigating Compliance Using XML | ||
|
||
XML based compliance provides a mechanism to compliance check device configurations stored in XML format. | ||
|
||
## Defining Compliance Rules | ||
|
||
Compliance rules are defined as XML `config-type`. | ||
|
||
The `config to match` field is used to specify an XPath query. This query is used to select specific nodes in the XML configurations for comparison. If the `config to match` field is left blank, all nodes in the configurations will be compared. | ||
|
||
### XPath in Config to Match | ||
|
||
XPath (XML Path Language) is a query language for selecting nodes from an XML document. In our application, XPath is used in the `config to match` field to specify which parts of the device configurations should be compared. | ||
|
||
### Basic XPath Syntax | ||
|
||
Here is a quick reference for basic XPath syntax: | ||
|
||
| Expression | Description | | ||
| --- | --- | | ||
| `nodename` | Selects all nodes with the name "nodename" | | ||
| `/` | Selects from the root node | | ||
| `//` | Selects nodes in the document from the current node that match the selection no matter where they are | | ||
|
||
For more detailed information on XPath syntax, you can refer to the [Supported XPath syntax](https://docs.python.org/3/library/xml.etree.elementtree.html#supported-xpath-syntax). | ||
|
||
This NTC [blog](https://blog.networktocode.com/post/parsing-xml-with-python-and-ansible/) also covers XPath in more details. | ||
|
||
Here are some examples of XPath queries that can be used in the `config to match` field: | ||
|
||
![Example XML Compliance Rules](../images/compliance-rule-xml.png) | ||
|
||
## Device Config Compliance View | ||
|
||
![Config Compliance Device View](../images/device-compliance-xml.png) | ||
|
||
## Interpreting Diff Output | ||
|
||
The diff output shows the differences between the device configurations. Each line in the diff output represents a node in the XML configurations. The node is identified by its XPath, and the value of the node is shown after the comma. | ||
|
||
Here's a sample 'missing' output: | ||
|
||
```text | ||
/config/system/aaa/user[1]/password[1], foo | ||
/config/system/aaa/user[1]/role[1], admin | ||
/config/system/aaa/radius/server[1]/host[1], 1.1.1.1 | ||
/config/system/aaa/radius/server[1]/secret[1], foopass | ||
/config/system/aaa/radius/server[2]/host[1], 2.2.2.2 | ||
/config/system/aaa/radius/server[2]/secret[1], bazpass | ||
``` | ||
|
||
This diff output represents the 'missing' portion when comparing the actual configuration to the intended configuration. Each line represents a node in the XML configuration that is presented in the intended configuration but is missing in the actual configuration. | ||
|
||
For example, the line `/config/system/aaa/user[1]/password[1], foo` indicates that the password node of the first user node under `/config/system/aaa` is expected to have a value of `foo` in the actual configuration. If this line appears in the diff output, it means this value is missing in the actual configuration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.