Comments (9)
Okay, I added support for this.
I added an optional_arg named 'auto_rollback_on_error' that defaults to True. This will allow people to choose to ignore errors if necessary.
This is needed as Cisco IOS can have issues with the self-signed certificate and 'revert trigger error' wasn't added in IOS until 12.4(20)T.
I need to update the IOS unit tests to test this.
from napalm.
Notes, on behavior:
Working:
#configure replace flash:rollback_config.txt force Total number of passes: 1 Rollback Done
Failed (invalid configuration command in the config):
#configure replace flash:candidate_config.txt force The rollback configlet from the last pass is listed below: ******** !List of Rollback Commands: adfjasdfadfa end ******** Rollback aborted after 5 passes The following commands are failed to apply to the IOS image. ******** adfjasdfadfa ********
from napalm.
Behavior when doing automatic rollback at IOS level.
#configure replace flash:candidate_config.txt force revert trigger error Failed to apply command adfjasdfadfa Aborting Rollback. Rollback failed.Reverting back to the original configuration: flash:pynet-rtr1-cfgJan--6-12-49-44.412-PST-0 ... Total number of passes: 1 Rollback Done The original configuration has been successfully restored. pynet-rtr1#show run | inc logging logging buffered 10000 no logging console
So it did rollback the change to the original config (the original logging buffered was 10000; the candidate_config.txt changes it to 20000).
from napalm.
Here is what 'revert trigger error' looks like when it works:
#configure replace flash:rollback_config.txt force revert trigger error Total number of passes: 1 Rollback Done
from napalm.
So revert trigger error seems the way to go, right?
from napalm.
@dbarrosop Yes it looks like it would probably work:
Key issues:
- Does IOS give you many false positives.
- Related to item 1, the 'crypto pki certificate chain TP-self-signed-' frequently generates an error. I believe this is due to the 'quit' line at the end which consists of ' \tquit\n' (i.e. two spaces and then a tab) so when you copy this manually the tab gets converted to a space.
- Do you need 'archive' configured-enabled for this to work (will need to test).
from napalm.
Just one comment, any prerequisites to make this work is just a matter to document them. So don't bother that much if the archive feature has to be enabled, if there is a reason for that people should do it. Dealing with IOS is already complex enough to not use that feature if it's available : )
from napalm.
@ktbyers Hi Kirk. Do you know if the issue with the quit command within the self-signed cert ever was resolved, or is there a workaround? I am having issues with ansible-napalm applying a Jinja2 template. When attempting the "configure replace" command manually on cli, I get the below error. Any guidance you can provide on this?
blah#configure replace flash:candidate_config.txt force revert trigger error
Failed to apply command no quit
Aborting Rollback.
Rollback failed.Reverting back to the original configuration: flash:archive-Sep--3-15-07-57.543-11 ..
from napalm.
@dbench Yep, looks like your configuration file (particularly your SSL certificate) is not valid (as per our other discussion in the separate GitHub thread).
Regards, Kirk
from napalm.
Related Issues (20)
- get_bgp_neighbors returns incorrect local-as for NXOS HOT 1
- NAPALM w/junos driver fails to properly identify/sanitize the output of `junos_views.junos_ipv6_neighbors_table` HOT 6
- Linting issue with napalm/base/validate.py:165:10 E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()` [pycodestyle]
- vEOS switch device - 'get_environment' fails due to "missing power supplies" HOT 3
- Proposal: new getter: `get_filesystems` HOT 7
- Ping does not work on NXOS when specifying source_interface HOT 1
- Change rollback behavior
- napalm cli does not parse the transport optional arg HOT 2
- nxos_ssh get_environment fails to parse temperature info
- NAPALM get_firewall_policies support
- optional_args doesn't have "huge_tree" as an available parameter for JunOS HOT 2
- Security Concern: Remove telnetlib for Improved Security HOT 1
- NAPALM fails to install on python 3.12 HOT 4
- IOS: discard_config() fails at large catalyst-stack HOT 9
- Cisco - configure replace fails on exit-af-interface command HOT 3
- junos: get_interfaces returns list instead of bool for an svi that is admin down HOT 2
- Proposed New Getter: `get_lag_interfaces` HOT 1
- typo in model name
- Napalm validate inside list search for patterns instead of fullmatch HOT 2
- Illegal Instruction Error Debian 12 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from napalm.