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:
Nathaniel Case 2018-08-06 10:41:57 -04:00 committed by GitHub
parent 086cb0233f
commit ab39481c31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 480 additions and 6 deletions

View file

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