Compare commits
3 Commits
main
...
b247ea0832
| Author | SHA1 | Date | |
|---|---|---|---|
| b247ea0832 | |||
| c476f04a8e | |||
| 5c185324d5 |
@@ -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
|
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user