mirror of
https://github.com/ansible-collections/community.routeros.git
synced 2025-08-05 18:54:51 +02:00
* Add SPDX license identifiers, mention all licenses in galaxy.yml. * Add default copyright headers. * Adjust remaining/missing entries. * Fix/add more copyright statements. * Add sanity test. * Add changelog. * Add missing license file. * Remove colon after 'Copyright'. * Avoid colon after 'Copyright' in lint script.
39 lines
1 KiB
YAML
39 lines
1 KiB
YAML
---
|
|
# Copyright (c) Ansible Project
|
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
- name: Run api module
|
|
community.routeros.api:
|
|
username: foo
|
|
password: bar
|
|
hostname: localhost
|
|
path: ip address
|
|
ignore_errors: true
|
|
register: result
|
|
|
|
- name: Validate result
|
|
assert:
|
|
that:
|
|
- result is failed
|
|
- "'Error while connecting: [Errno 111] Connection refused' == result.msg"
|
|
|
|
- name: Run command module
|
|
community.routeros.command:
|
|
commands:
|
|
- /ip address print
|
|
vars:
|
|
ansible_host: localhost
|
|
ansible_connection: ansible.netcommon.network_cli
|
|
ansible_network_os: community.routeros.routeros
|
|
ansible_user: foo
|
|
ansible_ssh_pass: bar
|
|
ansible_ssh_port: 12349
|
|
ignore_errors: true
|
|
register: result
|
|
|
|
- name: Validate result
|
|
assert:
|
|
that:
|
|
- result is failed
|
|
- "'Unable to connect to port 12349 ' in result.msg or 'ssh connect failed: Connection refused' in result.msg"
|