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:
Ricardo Carrillo Cruz 2018-02-05 04:13:43 -08:00 committed by GitHub
parent 40f7f4babf
commit 875c1343a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View file

@ -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 = """

View file

@ -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 = """