Debian Codegraph @

ansible_collections/community/routeros/tests/ee/roles/smoke/tasks/main.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - name: Run api module
7 community.routeros.api:
8 username: foo
9 password: bar
10 hostname: localhost
11 path: ip address
12 ignore_errors: true
13 register: result
14
15 - name: Validate result
16 assert:
17 that:
18 - result is failed
19 - result.msg in potential_errors
20 vars:
21 potential_errors:
22 - "Error while connecting: [Errno 111] Connection refused"
23 - "Error while connecting: [Errno 99] Cannot assign requested address"
24
25 - name: Run command module
26 community.routeros.command:
27 commands:
28 - /ip address print
29 vars:
30 ansible_host: localhost
31 ansible_connection: ansible.netcommon.network_cli
32 ansible_network_os: community.routeros.routeros
33 ansible_user: foo
34 ansible_ssh_pass: bar
35 ansible_ssh_port: 12349
36 ignore_errors: true
37 register: result
38
39 - name: Validate result
40 assert:
41 that:
42 - result is failed
43 - "'Unable to connect to port 12349 ' in result.msg or 'ssh connect failed: Connection refused' in result.msg"