File tree Expand file tree Collapse file tree 3 files changed +27
-9
lines changed Expand file tree Collapse file tree 3 files changed +27
-9
lines changed Original file line number Diff line number Diff line change 2
2
host_key_checking = False
3
3
retry_files_enabled = False
4
4
no_target_syslog = False
5
+ [libssh_connection]
6
+ publickey_algorithms = ssh-rsa
Original file line number Diff line number Diff line change 2
2
ansible.builtin.debug :
3
3
msg : " restoring from /backup/{{ rollback_date }}/{{ inventory_hostname }}.txt"
4
4
5
+ # # overwrite doesn't work as of June 2025
5
6
- name : Include task list in play
6
- ansible.builtin.include_tasks : " ios/{{ restore_mode | default('overwrite ') }}.yml"
7
+ ansible.builtin.include_tasks : " ios/{{ restore_mode | default('merge ') }}.yml"
7
8
8
9
- name : Print to terminal window
9
10
ansible.builtin.debug :
10
- msg : " Restore is complete for device {{ inventory_hostname }} is set to {{ rollback_date }} timestamp, restored with restore_mode {{ restore_mode | default('overwrite ') }} "
11
+ msg : " Restore is complete for device {{ inventory_hostname }} is set to {{ rollback_date }} timestamp, restored with restore_mode {{ restore_mode | default('merge ') }} "
Original file line number Diff line number Diff line change 1
1
---
2
- - name : Copy file over to flash on network device
3
- ansible.builtin.command : " scp -o StrictHostKeyChecking=no /tmp/{{ rollback_date }}/{{ inventory_hostname }}.txt {{ ansible_user }}@{{ inventory_hostname }}:flash:{{ rollback_date }}-{{ inventory_hostname }}.txt"
4
- delegate_to : localhost
2
+ # ## -O forces scp versus sftp which Cisco IOS does support
3
+ - name : Copy file over to flash on network device using SCP
4
+ ansible.builtin.shell : >
5
+ scp -O -o StrictHostKeyChecking=no
6
+ /backup/{{ rollback_date }}/{{ inventory_hostname }}.txt
7
+ {{ inventory_hostname }}:'flash:{{ rollback_date }}-{{ inventory_hostname }}.txt'
8
+ run_once : true
9
+ delegate_to : backup-server
5
10
6
- - name : Overwrite startup config - archive
7
- cisco.ios.ios_config :
8
- lines :
9
- - ' archive'
11
+ # - name: Copy file over to flash on network device
12
+ # ansible.builtin.shell: >
13
+ # scp -O -o StrictHostKeyChecking=no
14
+ # /tmp/{{ rollback_date }}/{{ inventory_hostname }}.txt
15
+ # {{ ansible_user }}@{{ inventory_hostname }}:'flash:{{ rollback_date }}-{{ inventory_hostname }}.txt'
16
+ # delegate_to: localhost
17
+ # run_once: true
18
+
19
+ # - name: Copy file over to flash on network device
20
+ # ansible.netcommon.net_put:
21
+ # src: "/tmp/{{ rollback_date }}/{{ inventory_hostname }}.txt"
22
+ # dest: "flash:{{ rollback_date }}-{{ inventory_hostname }}.txt"
10
23
11
24
- name : Overwrite startup config - overwrite
25
+ environment :
26
+ ANSIBLE_LIBSSH_PUBLICKEY_ALGORITHMS : ssh-rsa
12
27
cisco.ios.ios_command :
13
28
commands :
14
29
- command : ' configure replace flash://{{ rollback_date }}-{{ inventory_hostname }}.txt force'
You can’t perform that action at this time.
0 commit comments