mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-10 03:01:29 -07:00
Expose newline
option to cli_command module (#55451)
* Add newline to all cliconf plugins * Expose newline in cli_command * Also hook up to anything using transform_commands directly
This commit is contained in:
parent
8ff27c4e0c
commit
38890ddcaf
27 changed files with 67 additions and 53 deletions
|
@ -46,6 +46,14 @@ options:
|
|||
type: bool
|
||||
default: false
|
||||
required: false
|
||||
newline:
|
||||
description:
|
||||
- The boolean value, that when set to false will send I(answer) to the
|
||||
device without a trailing newline.
|
||||
type: bool
|
||||
default: true
|
||||
required: false
|
||||
version_added: 2.9
|
||||
check_all:
|
||||
description:
|
||||
- By default if any one of the prompts mentioned in C(prompt) option is matched it won't check
|
||||
|
@ -71,6 +79,13 @@ EXAMPLES = """
|
|||
prompt: This commit will replace or remove the entire running configuration
|
||||
answer: yes
|
||||
|
||||
- name: run command expecting user confirmation
|
||||
cli_command:
|
||||
command: show interface summary
|
||||
prompt: Press any key to continue
|
||||
answer: y
|
||||
newline: false
|
||||
|
||||
- name: run config mode command and handle prompt/answer
|
||||
cli_command:
|
||||
command: "{{ item }}"
|
||||
|
@ -129,6 +144,7 @@ def main():
|
|||
command=dict(type='str', required=True),
|
||||
prompt=dict(type='list', required=False),
|
||||
answer=dict(type='list', required=False),
|
||||
newline=dict(type='bool', default=True, required=False),
|
||||
sendonly=dict(type='bool', default=False, required=False),
|
||||
check_all=dict(type='bool', default=False, required=False),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue