forked from adschw1/ansible-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprompts.yml
70 lines (58 loc) · 1.53 KB
/
prompts.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
---
- name: Configure Cisco IOU
hosts: r1_r3
gather_facts: False
tasks:
- name: Bypass Prompts
debug:
msg: '{{inventory_hostname}}: {{ansible_host}} {{ansible_port}}'
- name:
shell: |
set timeout 5
spawn telnet {{ansible_host}} {{ansible_port}}
expect "Escape character is '^]'."
send "\n\n\n"
expect "Router>"
send "\nno\nno\nno\n"
args:
executable: /usr/bin/expect
changed_when: yes
delegate_to: localhost
- name: Configure Cisco IOU
hosts: pcs
gather_facts: False
tasks:
- name: Bypass Prompts
debug:
msg: '{{inventory_hostname}}: {{ansible_host}} {{ansible_port}}'
- name:
shell: |
set timeout 5
spawn telnet {{ansible_host}} {{ansible_port}}
expect "Escape character is '^]'."
send "\n\n\n"
expect "Router>"
send "no\n\n"
args:
executable: /usr/bin/expect
changed_when: yes
delegate_to: localhost
- name: Configure Cisco IOU
hosts: r2
gather_facts: False
tasks:
- name: Bypass Prompts
debug:
msg: '{{inventory_hostname}}: {{ansible_host}} {{ansible_port}}'
- name:
shell: |
set timeout 5
spawn telnet {{ansible_host}} {{ansible_port}}
expect "Escape character is '^]'."
send "\n\n\n"
expect "Router>"
send "no\n\n"
args:
executable: /usr/bin/expect
changed_when: yes
delegate_to: localhost