Perform local backup on target Nodegrid with Ansible

Perform local backup on target Nodegrid with Ansible

Ansible can be used to save current configuration of Nodegrid device and saved as a backup file.

In local backup, the saved configuration will be saved locally in the Nodegrid.

This is the template file one needs for this task: localbackup.j2
Here template file is in templates folder. So, the path is /etc/ansible/templates/localbackup.j2

  1. cd /system/toolkit
  2. save_settings
  3. set destination=local_system
  4. set filename={{ ng_backup }}
  5. save
  6. finish
  7. commit

Next task is to create a playbook to run this task: localbackup.yml
This yml file is at /etc/ansible/localbackup.yml 

  1. ---
  2.  - name: Take a backup of remote nodegrid
  3.    hosts: Nodegrid
  4.    become: true
  5.    gather_facts: yes
  6.    vars:
  7.      ng_backup: newbackup
  8.    tasks:
  9.    - name: Copy template to remote nodegrid
  10.      template:
  11.        src: templates/localbackup.j2
  12.        dest: /tmp/localbackup.cli

  13.    - name: Apply the backup
  14.      command: cli -f /tmp/localbackup.cli

  15.    - name: ACK
  16.      debug:
  17.        msg: " Backup is created "
Now, run the playbook with command: ansible-playbook localbackup.yml

One will see that backup will be saved in /backup folder with filename given in the playbook.
    • Related Articles

    • Backing up the Nodegrid Appliance

      Nodegrid backup is complete backup of all configuration. Follow these steps to take backup through WebUI, 1. Login as admin and navigate to System::Toolkit 2. Select Save Settings  3. One has to select the destination to store the backup     Local ...
    • Restoring backups to a Nodegrid Appliance

      Nodegrid restore is an easy way to restore backups from stored configuration backups  Follow these steps to restore backup to the Nodegrid 1. Login as admin and navigate to System::Toolkit 2. Select Apply Settings 3. Now one has to choose where to ...
    • Ansible configuration on remote Nodegrid devices

      Ansible playbook can be used to automate remote devices. Every remote device needs to have one ansible user to apply the automation. Follow this script to have complete configuration of ansible user, ssh keys, sudo permission on remote Nodegrid ...
    • Troubleshooting steps for ZPE Cloud scheduled Backup failures

      Verify the affected system's time is set correctly If there is a significant time difference between ZPE Cloud and the target system, the backup will not upload properly causing the job to fail. Check the system's time from the GUI: System :: Date ...
    • How to Save and Restore backup configuration from/to Nodegrid

      To Save the current configuration of your Nodegrid, follow the steps below: WebUI 1. Go to System, Toolkit, and click on Save Settings icon. 2. Select the option where you want to save the configuration:        a. Local System: enter the file name ...