nautobot / nautobot-app-golden-config

Golden Configuration App for Nautobot.
https://docs.nautobot.com/projects/golden-config/en/latest/
Other
98 stars 56 forks source link

Incorrect transport method is used causing job to fail #751

Closed SanderDelden closed 5 months ago

SanderDelden commented 5 months ago

Environment

Expected Behavior

I have added an Arista DCS-7048T-A-F and wish to back up the configuration of this device using Nautobot Golden Config. I want to use SSH to connect to the device as we are not using the eAPI for these devices.

To achieve this I have set the local config context data of the device to:

{
    "nautobot_plugin_nornir": {
        "connection_options": {
            "napalm": {
                "extras": {
                    "optional_args": {
                        "transport": "ssh"
                    }
                }
            }
        },
        "secret_access_type": "Generic"
    }
}

Observed Behavior

The backup job fails with E1015: get_config method failed with an unexpected issue: Socket error during eAPI connection: [Errno 111] Connection refused. It's still attempting to connect to the eAPI despite transport: ssh being specified in the config context.

Steps to Reproduce

  1. Setup Nautobot and Golden Config App.
  2. Add Arista device to Nautobot
  3. Set config context data of device to adjust Napalm transport setting to ssh
  4. Execute backup of device
SanderDelden commented 5 months ago

Setting the transport type in nautobot_config.py works as expected, the backup job now runs successfully.

Example of my nautobot_config.py:

PLUGINS_CONFIG = {
    "nautobot_plugin_nornir": {
        "use_config_context": {"secrets": True},
        "connection_options": {
            "napalm": {
                "extras": {
                    "optional_args": {
                        "transport": "ssh"
                    }
                }
            }
        },
        "nornir_settings": {
            "credentials": "nautobot_plugin_nornir.plugins.credentials.nautobot_secrets.CredentialsNautobotSecrets",
            "runner": {
                "plugin": "threaded",
                "options": {
                    "num_workers": 20,
                },
            },
        },
    },
}
itdependsnetworks commented 5 months ago

I think you missed this

PLUGINS_CONFIG = {
    "nautobot_plugin_nornir": {
        "use_config_context": {
            "connection_options": True
        },
    }
}

Going to close this as: