mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-21 07:40:22 -07:00
cli_command module (#42916)
* Create cli_command module to do direct cliconf calls * Update edgeos cliconf signature to match. * cli_command is cli-only * Add tests
This commit is contained in:
parent
086cb0233f
commit
ab39481c31
15 changed files with 480 additions and 6 deletions
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
- debug:
|
||||
msg: "START cli/cli_command.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- block:
|
||||
- name: get output for single command
|
||||
cli_command:
|
||||
commands:
|
||||
- show version
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.stdout is defined"
|
||||
|
||||
- name: get output for multiple commands
|
||||
cli_command:
|
||||
commands:
|
||||
- show version
|
||||
- show interfaces
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.stdout is defined"
|
||||
- "result.stdout | length == 2"
|
||||
|
||||
when: ansible_connection == 'network_cli'
|
||||
|
||||
- debug: msg="END cli/cli_command.yaml on connection={{ ansible_connection }}"
|
Loading…
Add table
Add a link
Reference in a new issue