nautobot / nornir-nautobot

Nornir inventory and plugins for Nautobot.
https://docs.nautobot.com/projects/nornir-nautobot/en/latest/
31 stars 25 forks source link

Netmiko nornir send_command needs enable= #64

Closed jeffkala closed 5 months ago

jeffkala commented 1 year ago

https://github.com/nautobot/nornir-nautobot/blob/4d6a4da7388461b70a0115c00fd3cef1f768712f/nornir_nautobot/plugins/tasks/dispatcher/default.py#L237

Right now if you go into > mode on cisco_ios and you don't have permissions to run show run it isn't going to try the DEVICE_SECRET and go into enable mode to get the config.

The job itself shows successful but the backup itself in Git is saved as:

                      ^
% Invalid input detected at '^' marker.
jeffkala commented 1 year ago

https://networktocode.slack.com/archives/C01NWPK6WHL/p1663864627106539

merriry commented 1 year ago

changing line 237 to result = task.run(task=netmiko_send_command, command_string=command, enable=True)

does work as a workaround.

jeffkala commented 1 year ago

Duplication steps:

  1. Use either creds_env or settings_env credential paths.
  2. Have your PASSWORD and SECRET be different values. (not positive this matters)
  3. Run a backup on a device that drops the user into > and user doesn't have show run access unless they go into enable mode.
jvanderaa commented 1 year ago

Run a backup? What is this in relation to? @jeffkala

jeffkala commented 1 year ago

@jvanderaa this is related to GC plugin, where I was able to duplicate this.

JostLuebbe commented 6 months ago

Hey guys, any chance we could get @merriry's suggestion merged into the main library? The fix works great, but I'm currently having to maintain this workaround as part of our build process and its such a small thing I was hoping we could just make make it available by default.