miaow2 / netbox-config-diff

Find diff and push rendered device configurations from NetBox to devices and apply them.
https://miaow2.github.io/netbox-config-diff/
Apache License 2.0
79 stars 5 forks source link

Juniper Junos Config Compliance Diff Failure #49

Closed msmith8fti closed 7 months ago

msmith8fti commented 11 months ago

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

msmith8fti commented 11 months ago

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
miaow2 commented 11 months ago

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

miaow2 commented 11 months ago

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?

msmith8fti commented 11 months ago

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?

miaow2 commented 11 months ago

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

for configuration requests I should make some tweaks

miaow2 commented 7 months ago

Fix this in PR #58