22 lines
594 B
YAML
22 lines
594 B
YAML
---
|
|
- name: Backup router
|
|
hosts: mikrotik_routers
|
|
gather_facts: false
|
|
connection: ansible.netcommon.network_cli
|
|
|
|
tasks:
|
|
- name: backup-file create
|
|
community.routeros.command:
|
|
commands: /system/backup/save dont-encrypt=yes name=backup_mikrotik
|
|
|
|
- name: backup-file download
|
|
net_get:
|
|
src: "/backup_mikrotik.backup"
|
|
dest: "/ansible-for-games/backups/{{inventory_hostname}}"
|
|
protocol: scp
|
|
|
|
# - name: Save backup with correct hostname
|
|
# ansible.builtin.copy:
|
|
# src: /ansible-for-games/
|
|
# dest: "/ansible-for-games/backups/{{inventory_hostname}}"
|