From b497723769cbcc00f302979bf749e1d6b46969ca Mon Sep 17 00:00:00 2001 From: jakub Date: Fri, 19 Sep 2025 11:13:44 +0000 Subject: [PATCH] Update mikrotikbackup.yml --- mikrotikbackup.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mikrotikbackup.yml b/mikrotikbackup.yml index a3623c2..536e298 100644 --- a/mikrotikbackup.yml +++ b/mikrotikbackup.yml @@ -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,11 +52,11 @@ 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 - name: Remove backup file from router shell: timeout 15 ssh -o StrictHostKeyChecking=no {{ ansible_user }}@{{ ansible_host }} -p {{ ansible_port }} "/file remove {{ router_name }}-{{ current_date }}-backup.backup" delegate_to: localhost - when: system_identity.rc == 0 + when: system_identity.rc == 0 \ No newline at end of file