2018-08-06 16:41:57 +02:00
|
|
|
---
|
|
|
|
- debug:
|
|
|
|
msg: "START cli/cli_command.yaml on connection={{ ansible_connection }}"
|
|
|
|
|
2018-08-13 07:32:43 +02:00
|
|
|
- block:
|
|
|
|
- name: get output for single command
|
|
|
|
cli_command:
|
|
|
|
command: show version
|
|
|
|
register: result
|
2018-08-06 16:41:57 +02:00
|
|
|
|
2018-08-13 07:32:43 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
- "result.stdout is defined"
|
2018-08-06 16:41:57 +02:00
|
|
|
|
2018-08-13 07:32:43 +02:00
|
|
|
- name: test with prompt and answer
|
|
|
|
cli_command:
|
|
|
|
command: "{{ item }}"
|
|
|
|
prompt:
|
|
|
|
- "Exit with uncommitted changes"
|
|
|
|
answer: yes
|
|
|
|
loop:
|
|
|
|
- configure
|
|
|
|
- set system syslog file test any any
|
2018-08-23 11:18:44 +02:00
|
|
|
- rollback
|
2018-08-13 07:32:43 +02:00
|
|
|
- exit
|
|
|
|
register: result
|
2018-08-06 16:41:57 +02:00
|
|
|
|
2018-08-13 07:32:43 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
when: ansible_connection == 'network_cli'
|
2018-08-06 16:41:57 +02:00
|
|
|
|
|
|
|
- debug: msg="END cli/cli_command.yaml on connection={{ ansible_connection }}"
|