2018-04-06 14:16:07 +02:00
|
|
|
---
|
|
|
|
- debug: msg="START cli/misc_tests.yaml on connection={{ ansible_connection }}"
|
|
|
|
|
|
|
|
|
|
|
|
# test become and unbecome
|
|
|
|
- block:
|
|
|
|
- name: command that does require become (should fail)
|
|
|
|
eos_command:
|
|
|
|
commands: show running-config
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
become: no
|
|
|
|
ignore_errors: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.failed == true'
|
2018-08-06 16:41:57 +02:00
|
|
|
- '"privileged mode required" in result.msg'
|
2018-04-06 14:16:07 +02:00
|
|
|
|
|
|
|
- name: command that doesn't require become
|
|
|
|
eos_command:
|
|
|
|
commands: show uptime
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
become: no
|
|
|
|
|
2018-05-08 18:06:37 +02:00
|
|
|
# Test that transport values are properly ignored
|
|
|
|
- name: wrong transport specified
|
|
|
|
eos_command:
|
|
|
|
commands: show version
|
|
|
|
transport: eapi
|
|
|
|
|
|
|
|
- name: wrong transport specified in provider
|
|
|
|
eos_command:
|
|
|
|
commands: show version
|
|
|
|
provider: "{{ eapi }}"
|
|
|
|
|
2018-04-06 14:16:07 +02:00
|
|
|
when: "ansible_connection != 'local'"
|