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
pull/35733/head
Ricardo Carrillo Cruz 7 years ago committed by GitHub
parent 40f7f4babf
commit 875c1343a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,6 +37,8 @@ description:
extends_documentation_fragment: ios
notes:
- 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:
commands:
description:
@ -112,6 +114,12 @@ tasks:
wait_for:
- result[0] contains IOS
- 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 = """

@ -89,6 +89,8 @@ notes:
- Tested against VYOS 1.1.7
- 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.
- 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 = """
@ -108,6 +110,13 @@ tasks:
- show hardware cpu
wait_for:
- "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 = """

Loading…
Cancel
Save