Skip to content

Latest commit

 

History

History
131 lines (108 loc) · 4.32 KB

README.md

File metadata and controls

131 lines (108 loc) · 4.32 KB

Ansible Network restore

CI OpenSSF Best Practices

Ansible Network restore Collection is to provide a platform-agnostic way of managing network backup restore on supported network devices.

Using the platform-agnostic role network.restore.run as part of a network.restore collection.

Capabilities

Full restore:

  • This enables the user to fetch running configuration from the device and save the restore to local or remote data-store
  • Users can also push restore files onto GitHub with tags.

Differential restore:

  • This enables users to restore configuration only when there has been some change since the last time we did a restore.
  • Users can use this operation to get differential restore and save the backed-up files to either the local data store or to the GitHub repository
  • Users can also push restore files onto GitHub with tags.

Examples

Full Network restore

Read backup from the local data store and perform full restore.

run.yml
---
- hosts: rtr1
  gather_facts: true
  tasks:
    - name: Network Restore 
      ansible.builtin.include_role:
        name: network.restore.run
      vars:
        operation: restore
        data_store:
          local: "./network_local_restore/network"

Read backup from the remote data store and perform full config restore.

run.yml
---
- hosts: rtr1
  gather_facts: true
  tasks:
    - name: Network Restore
      ansible.builtin.include_role:
        name: network.restore.run
      vars:
        operation: restore
        data_store:
          scm:  
            origin:
              url: "{{ GIT_REPO }}"
              token: "{{ GH_ACCESS_TOKEN }}"
              tag: "{{ tag }}"
              user:
                name: "{{ username }}"
                email: "{{ email }}"

Differential Network restore

Read backup from the local data store and perform restore if diff exists.

run.yml
---
- hosts: rtr1
  gather_facts: true
  tasks:
    - name: Network restore and Resource Manager
      ansible.builtin.include_role:
        name: network.restore.run
      vars:
        operation: restore
        diff: true
        data_store:
          local: "./network_local_restore/network"

Read backup from the remote data store and perform restore if diff exists.

run.yml
---
- hosts: rtr1
  gather_facts: true
  tasks:
    - name: Network restore and Resource Manager
      ansible.builtin.include_role:
        name: network.restore.run
      vars:
        operation: restore
        diff: true
        data_store:
          scm:  
            origin:
              url: "{{ GIT_REPO }}"
              token: "{{ GH_ACCESS_TOKEN }}"
              tag: "{{ }}"

See Also:

Advantages of Using this Role

Provide a single platform agnostics entry point to manage network restore and restore use cases.

Code of Conduct

This collection follows the Ansible project's Code of Conduct. Please read and familiarize yourself with this document.

More information

Licensing

GNU General Public License v3.0 or later.

See LICENSE to see the full text.