mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
553 B
YAML
27 lines
553 B
YAML
6 years ago
|
---
|
||
|
- debug:
|
||
|
msg: "START cli/cli_command.yaml on connection={{ ansible_connection }}"
|
||
|
|
||
|
- name: get output for single command
|
||
|
cli_command:
|
||
6 years ago
|
command: show version
|
||
6 years ago
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- "result.changed == false"
|
||
|
- "result.stdout is defined"
|
||
|
|
||
6 years ago
|
- name: send invalid command
|
||
6 years ago
|
cli_command:
|
||
6 years ago
|
command: 'show foo'
|
||
6 years ago
|
register: result
|
||
6 years ago
|
ignore_errors: yes
|
||
6 years ago
|
|
||
|
- assert:
|
||
|
that:
|
||
6 years ago
|
- "result.failed == true"
|
||
|
- "result.msg is defined"
|
||
6 years ago
|
|
||
|
- debug: msg="END cli/cli_command.yaml on connection={{ ansible_connection }}"
|