-
Notifications
You must be signed in to change notification settings - Fork 13
/
copy_config_using_cli_prompt.yml
71 lines (66 loc) · 1.79 KB
/
copy_config_using_cli_prompt.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
- hosts: all
gather_facts: False
collections:
- arubanetworks.aoscx
vars:
ansible_connection: network_cli
tasks:
- name: Upload via TFTP
aoscx_command:
commands:
- command: 'copy tftp://10.0.9.87/TL_10_08_0001CN.swi secondary vrf mgmt'
prompt:
- '.*Continue.*'
answer:
- y
- name: Show images
aoscx_command:
commands: ["show image"]
- hosts: all
gather_facts: False
collections:
- arubanetworks.aoscx
vars:
ansible_connection: network_cli
tasks:
- name: Upload via SFTP
aoscx_command:
commands:
- command: "copy sftp://[email protected]/TL_10_07_0030O.swi primary vrf mgmt"
check_all: True
prompt:
- '.*\(y\/n\)\?.*'
- '.*password:.*'
answer:
- 'y'
- 'password'
- name: Show images
aoscx_command:
commands: ["show image"]
- hosts: all
collections:
- arubanetworks.aoscx
gather_facts: False
vars:
ansible_connection: network_cli
tasks:
- name: Optional - Accept authenticity Upload via SCP
aoscx_command:
commands:
- command: "copy scp://[email protected]/config.txt running-config vrf mgmt"
check_all: True
prompt:
- '.*\(yes\/no.*\)\?.*'
answer:
- 'yes'
ignore_errors: True
# If fingerprint prompt does not come up then this will fail which is okay
- name: Copy config via SCP
aoscx_command:
commands:
- command: "copy scp://[email protected]/config.txt running-config vrf mgmt"
prompt:
- '.*password:.*'
answer:
- 'password'