2018-08-06 14:41:57 +00:00
|
|
|
---
|
|
|
|
- debug:
|
|
|
|
msg: "START cli/cli_command.yaml on connection={{ ansible_connection }}"
|
|
|
|
|
|
|
|
- name: get output for single command
|
|
|
|
cli_command:
|
2018-08-09 16:46:38 +00:00
|
|
|
command: show version
|
2018-08-06 14:41:57 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
- "result.stdout is defined"
|
|
|
|
|
2018-08-09 16:46:38 +00:00
|
|
|
- name: send invalid command
|
2018-08-06 14:41:57 +00:00
|
|
|
cli_command:
|
2018-08-09 16:46:38 +00:00
|
|
|
command: 'show foo'
|
2018-08-06 14:41:57 +00:00
|
|
|
register: result
|
2018-08-09 16:46:38 +00:00
|
|
|
ignore_errors: yes
|
2018-08-06 14:41:57 +00:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2018-08-09 16:46:38 +00:00
|
|
|
- "result.failed == true"
|
|
|
|
- "result.msg is defined"
|
2018-08-06 14:41:57 +00:00
|
|
|
|
|
|
|
- debug: msg="END cli/cli_command.yaml on connection={{ ansible_connection }}"
|