mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ab39481c31
* Create cli_command module to do direct cliconf calls * Update edgeos cliconf signature to match. * cli_command is cli-only * Add tests
37 lines
946 B
YAML
37 lines
946 B
YAML
---
|
|
- 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'
|
|
- '"privileged mode required" in result.msg'
|
|
|
|
- name: command that doesn't require become
|
|
eos_command:
|
|
commands: show uptime
|
|
provider: "{{ cli }}"
|
|
become: no
|
|
|
|
# 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 }}"
|
|
|
|
when: "ansible_connection != 'local'"
|