Document the multiline prompt/answer format for ios commands (#35716)
* Document the multiline prompt/answer format for ios commands Fixes #34468 * Put a note * Add also docs for vyos
This commit is contained in:
parent
40f7f4babf
commit
875c1343a9
2 changed files with 17 additions and 0 deletions
|
@ -37,6 +37,8 @@ description:
|
||||||
extends_documentation_fragment: ios
|
extends_documentation_fragment: ios
|
||||||
notes:
|
notes:
|
||||||
- Tested against IOS 15.6
|
- Tested against IOS 15.6
|
||||||
|
- If a command sent to the device requires answering a prompt, it is possible
|
||||||
|
to pass a dict containing I(command), I(answer) and I(prompt). See examples.
|
||||||
options:
|
options:
|
||||||
commands:
|
commands:
|
||||||
description:
|
description:
|
||||||
|
@ -112,6 +114,12 @@ tasks:
|
||||||
wait_for:
|
wait_for:
|
||||||
- result[0] contains IOS
|
- result[0] contains IOS
|
||||||
- result[1] contains Loopback0
|
- result[1] contains Loopback0
|
||||||
|
- name: run command that requires answering a prompt
|
||||||
|
ios_command:
|
||||||
|
commands:
|
||||||
|
- command: 'clear counters GigabitEthernet0/2'
|
||||||
|
prompt: 'Clear "show interface" counters on this interface [confirm]'
|
||||||
|
answer: c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = """
|
RETURN = """
|
||||||
|
|
|
@ -89,6 +89,8 @@ notes:
|
||||||
- Tested against VYOS 1.1.7
|
- Tested against VYOS 1.1.7
|
||||||
- Running C(show system boot-messages all) will cause the module to hang since
|
- Running C(show system boot-messages all) will cause the module to hang since
|
||||||
VyOS is using a custom pager setting to display the output of that command.
|
VyOS is using a custom pager setting to display the output of that command.
|
||||||
|
- If a command sent to the device requires answering a prompt, it is possible
|
||||||
|
to pass a dict containing I(command), I(answer) and I(prompt). See examples.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
|
@ -108,6 +110,13 @@ tasks:
|
||||||
- show hardware cpu
|
- show hardware cpu
|
||||||
wait_for:
|
wait_for:
|
||||||
- "result[0] contains 'VyOS 1.1.7'"
|
- "result[0] contains 'VyOS 1.1.7'"
|
||||||
|
|
||||||
|
- name: run command that requires answering a prompt
|
||||||
|
vyos_command:
|
||||||
|
commands:
|
||||||
|
- command: 'rollback 1'
|
||||||
|
prompt: 'Proceed with reboot? [confirm][y]'
|
||||||
|
answer: y
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = """
|
RETURN = """
|
||||||
|
|
Loading…
Reference in a new issue