Factory default configuration preserving some parts

I wanted to know what is the best way to factory default by Arista Switches without losing management access. So essentially, I need to reset the entire configuration to default except management interface config, SSH state and one of the users.

The purpose it to have a Ansible playbook that when ran would erase everything without me having to have serial console access.

I thought of saving a default config file (with required params in place) on some server and have my playbook pull it and push it into start-up config.

Yeah, I think I would recommend what you've already come up with. Build a minimal config template with just your management interface configured, push it to start-up config, and then if desired, also apply it to the running system with "configure replace startup-config"

In configure session, you are editing a candidate configuration file, not the running-config. This means any changes you made are not effective until you enter the "commit" command

By default when you enter in a configuration session, the running-config is copied to your candidate configuration.

In configuration session you can enter "rollback clean-config" which start over with factory default configuration file.

Next add all management config you need.

You can use "show session-config" to view the candidate configuration file.

When happy with your configuration file, enter "commit" to overwrite the running-config with your candidate configuration.

If you do not want to implement the changes, you can enter "abort" in the configuration session to cancel the session and delete the candidate configuration file. The running configuration will not be affected.

Recent Questions

DISCLAIMER:While this platform is not officially monitored by Arista Networks, Arista affiliated persons, including Arista employees, will periodically contribute. Arista affiliated persons are not authorized Arista spokespeople and contributions posted to this forum by Arista Networks employees, partners, and customers do not necessarily represent the position or view of Arista Networks.

This forum is NOT to be used for official Arista Networks product technical support. For technical support of any Arista product, please contact Technical Support at support@arista.com.