miaow2/netbox-config-diff

Juniper Junos Config Compliance Diff Failure

Closed this issue · 6 comments

Netbox Version 3.6.5

When defining platform settings for driver juniper_junos we correctly configure the command as 'show configuration | display set' which displays the current junos configuration as set commands. After running the Config Compliance job - the actual configuration is NOT show in 'display set' format but instead as hierarchical format.

To Reproduce
Steps to reproduce the behavior:

  1. Define platform settings for juniper_junos and set command as 'show configuration | display set'
  2. Run ConfigDiffScripts which is successful
  3. View Config Compliance against device - diff does not work as rendered config is in set format, collected config is not in set format

Expected behavior
Collected configuration in 'set' format

As an update -

  1. When I first create config compliance - it is show in 'set' format
  2. Creating a 'configuration request' against the same device shows improper diffs as the actual config is show in hierarchical format
  3. AFTER creating configuration request, config compliances for device show incorrect diffs (due to lack of SET format) but this only changed after creating configuration requests

Hi @msmith8fti
ConfigDiffScript uses command from PlatfromSetting for getting configuration from device
ConfigurationRequest uses scrapli-cfg for configuring devices and getting configuration from them and scrapli-cfg get config from junos devices in hierarchical format, thats why in ConfigCompliance object shows in that format

and @msmith8fti one more question, do you try to configure juniper devices with these plugin and configuration in set format? If yes, was it successful?

and @msmith8fti one more question, do you try to configure juniper devices with these plugin and configuration in set format? If yes, was it successful?

Yes plugin is setup with command to gather configuration in set format. Am I to understand we can't diff configuration between running configuration and template for Junos config in set format?

you can check diff for junos in set format in ConfigDiffScript script

for configuration requests I should make some tweaks

Fix this in PR #58