rohitthakur2590 / network.backup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ansible Network Backup

CI OpenSSF Best Practices

Ansible Network Backup Collection provides a platform-agnostic way of managing network backup on supported network devices.

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

Capabilities

Full Backup:

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

Differential backup:

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

Examples

Full Network Backup

fetch running config and saves the backup to the local data store.

run.yml
---
- hosts: rtr1
  gather_facts: true
  tasks:
    - name: Network Backup and Resource Manager
      ansible.builtin.include_role:
        name: network.backup.run
      vars:
        operation: backup
        type: full
        data_store:
          local: "./network_local_backup/network"

fetch running config and publish the backup to a remote repository.

run.yml
---
- hosts: rtr1
  gather_facts: true
  tasks:
    - name: Network Backup and Resource Manager
      ansible.builtin.include_role:
        name: network.backup.run
      vars:
        operation: backup
        type: full
        data_store:
          scm:  
            origin:
              url: "{{ GIT_REPO }}"
              token: "{{ GH_ACCESS_TOKEN }}"
              user:
                name: "{{ username }}"
                email: "{{ email }}"

Differential Network Backup

fetch running config and saves the backup to the local data store.

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

fetch running config and publish the backup to a remote repository.

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

See Also:

Advantages of Using this Role

Provide a single platform agnostics entry point to manage network backup 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.

About

License:GNU General Public License v3.0