2026-06-07 08:34:13 +02:00
|
|
|
---
|
2026-06-08 19:36:14 +02:00
|
|
|
# Generate a human-readable /export and a binary /system backup on the device,
|
|
|
|
|
# then pull both into the repo under backups/<host>/. net_get uses SCP over the
|
|
|
|
|
# RouterOS SSH service (same channel play_bootstrap.yml uses for net_put).
|
|
|
|
|
|
|
|
|
|
- name: Generate a config export on the device
|
|
|
|
|
community.routeros.command:
|
|
|
|
|
commands:
|
|
|
|
|
- /export file=export
|
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
|
|
- name: Generate a binary system backup on the device
|
|
|
|
|
community.routeros.command:
|
|
|
|
|
commands:
|
|
|
|
|
- /system/backup/save name=backup dont-encrypt=yes
|
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
|
|
- name: Fetch the export file into the repo
|
|
|
|
|
ansible.netcommon.net_get:
|
|
|
|
|
src: "export.rsc"
|
|
|
|
|
dest: "{{ playbook_dir }}/backups/{{ inventory_hostname }}/export.rsc"
|
|
|
|
|
|
|
|
|
|
- name: Fetch the binary backup into the repo
|
|
|
|
|
ansible.netcommon.net_get:
|
|
|
|
|
src: "backup.backup"
|
|
|
|
|
dest: "{{ playbook_dir }}/backups/{{ inventory_hostname }}/backup.backup"
|