Datasource Reference¶
The Operational Compliance app registers three Git datasource content types with Nautobot, allowing you to manage validation rules, rule groups, command parser templates, and offline command outputs entirely from Git repositories. When a Git repository is synced, the app creates or updates the corresponding database objects for rules and parsers, and refreshes offline output files on disk.
Datasource Content Types¶
| Content Type | Identifier | Purpose |
|---|---|---|
| Validation Rules | nautobot_operational_compliance.validation_rules |
Syncs validation rules, their command parsers (collectors), and rule groups from YAML files |
| Command Parsers | nautobot_operational_compliance.command_parsers |
Provides custom TextFSM and TTP parser templates for command output parsing |
| Offline Command Outputs | nautobot_operational_compliance.offline_command_outputs |
Provides stored command output files so snapshots can be taken without connecting to live devices |
To use a datasource, create a Git Repository in Nautobot (Extensibility > Git Repositories) and select the appropriate content type under Provided Contents.
Example: Setting Up Rules and Parsers Datasources¶
Here is a complete example showing how to set up a single Git repository for validation rules, and a second repository for custom parser templates.
Repository 1: Validation Rules¶
Git Repository Configuration in Nautobot:
- Name:
Compliance Rules - Provided Contents:
Operational Compliance App Validation Rules
Repository layout:
compliance-rules/
├── oc/
│ ├── rules/
│ │ ├── routing.yml
│ │ ├── interfaces.yml
│ │ └── system.yml
│ └── rule-groups/
│ └── change_management.yml
Repository 2: Custom Parser Templates¶
Git Repository Configuration in Nautobot:
- Name:
Compliance Parsers - Provided Contents:
Operational Compliance App Command Parsers
Repository layout:
compliance-parsers/
├── parsers/
│ ├── cisco_ios/
│ │ ├── show_ip_bgp_summary.textfsm
│ │ └── show_ip_ospf_neighbor.textfsm
│ ├── arista_eos/
│ │ ├── show_ip_bgp_summary.textfsm
│ │ └── show_ip_ospf_neighbor.ttp
│ └── juniper_junos/
│ └── show_bgp_summary.ttp
Tip
You can also combine both content types into a single Git repository by selecting both Operational Compliance App Validation Rules and Operational Compliance App Command Parsers under Provided Contents when configuring the repository. In that case, the repository would contain both the oc/ directory and the parsers/ directory at the root level.