3
0
forked from jakub/ansible

Update mikrotikbackup.yml

This commit is contained in:
2025-09-19 10:58:22 +00:00
parent c476f04a8e
commit b247ea0832

View File

@@ -7,7 +7,7 @@
- name: Ensure output directory exists
ansible.builtin.file:
path: output
path: /opt/mikrotik_backups
state: directory
mode: '0755'
delegate_to: localhost
@@ -42,7 +42,7 @@
- name: Save export to local file
ansible.builtin.copy:
content: "{{ export_output.stdout }}"
dest: "output/{{ router_name }}-{{ current_date }}.config"
dest: "/opt/mikrotik_backups/{{ router_name }}-{{ current_date }}.config"
delegate_to: localhost
when: export_output.rc == 0
@@ -52,7 +52,7 @@
when: system_identity.rc == 0
- name: Download binary backup
shell: timeout 15 scp -o StrictHostKeyChecking=no -P {{ ansible_port }} {{ ansible_user }}@{{ ansible_host }}:{{ router_name }}-{{ current_date }}-backup.backup output/
shell: timeout 15 scp -o StrictHostKeyChecking=no -P {{ ansible_port }} {{ ansible_user }}@{{ ansible_host }}:{{ router_name }}-{{ current_date }}-backup.backup /opt/mikrotik_backups/
delegate_to: localhost
when: system_identity.rc == 0