Files
demo2026-1/files/backup.yml

42 lines
1.1 KiB
YAML
Raw Normal View History

2025-06-21 19:05:41 +05:00
---
- name: Backup your router configuration HQ-RTR and BR-RTR
hosts:
- HQ-RTR
- BR-RTR
gather_facts: no
tasks:
- name: Create local folder backup
ansible.builtin.file:
path: "/etc/ansible/NETWORK_INFO/{{ inventory_hostname }}/{{ item }}"
state: directory
loop:
- "frr"
delegate_to: localhost
- name: Copy configuration FRR
ansible.builtin.fetch:
src: "/etc/frr/{{ item }}"
dest: "/etc/ansible/NETWORK_INFO/{{ inventory_hostname }}/frr/"
flat: yes
loop:
- "daemons"
- "frr.conf"
- "frr.conf.sav"
- "vtysh.conf"
become: yes
- name: Copy saved rules nftables
ansible.builtin.fetch:
src: /etc/nftables.conf
2025-06-25 16:16:01 +05:00
dest: /etc/ansible/NETWORK_INFO/{{ inventory_hostname }}/nftables.conf
2025-06-21 19:05:41 +05:00
flat: yes
become: yes
- name: Copy configuration network interfaces
ansible.builtin.fetch:
src: /etc/network/interfaces
dest: /etc/ansible/NETWORK_INFO/{{ inventory_hostname }}/interfaces
flat: yes
become: yes