Compare commits

...

3 Commits

Author SHA1 Message Date
b247ea0832 Update mikrotikbackup.yml 2025-09-19 10:58:22 +00:00
c476f04a8e Update inv_mikrotiks 2025-09-19 09:30:23 +00:00
5c185324d5 Update inv_linuxes 2025-09-18 12:31:07 +00:00
3 changed files with 5 additions and 8 deletions

View File

@@ -1,5 +1,2 @@
[linux_servers] [linux_servers]
jimbuntu ansible_host=192.168.19.4 proxmox ansible_host=192.168.69.2
jim_storage ansible_host=192.168.19.7
portainer2 ansible_host=192.168.52.9
portainernode ansible_host=192.168.52.21

View File

@@ -1,2 +1,2 @@
[mikrotiks] [mikrotiks]
storage ansible_host=192.168.19.3 ansible_ssh_common_args='-o StrictHostKeyChecking=no' main_mikrotik_fencl ansible_host=192.168.69.1

View File

@@ -7,7 +7,7 @@
- name: Ensure output directory exists - name: Ensure output directory exists
ansible.builtin.file: ansible.builtin.file:
path: output path: /opt/mikrotik_backups
state: directory state: directory
mode: '0755' mode: '0755'
delegate_to: localhost delegate_to: localhost
@@ -42,7 +42,7 @@
- name: Save export to local file - name: Save export to local file
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ export_output.stdout }}" content: "{{ export_output.stdout }}"
dest: "output/{{ router_name }}-{{ current_date }}.config" dest: "/opt/mikrotik_backups/{{ router_name }}-{{ current_date }}.config"
delegate_to: localhost delegate_to: localhost
when: export_output.rc == 0 when: export_output.rc == 0
@@ -52,7 +52,7 @@
when: system_identity.rc == 0 when: system_identity.rc == 0
- name: Download binary backup - 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 delegate_to: localhost
when: system_identity.rc == 0 when: system_identity.rc == 0