network/tests/tasks/assert_bond_options.yml
Rich Megginson b7c6a253ab test: fix some Ansible warnings not caught by lint
Do not use templating in `when:`, `that:`, `until:`.  These
are evaluated as Jinja statements.  In cases where the string
used is long or awkward to generate in-line, use an
intermediate var for the value.

Use a unique loop var instead of `item` in cases where a loop
may be called in a nested context.

Fix some formatting.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2024-07-25 08:35:17 -06:00

21 lines
660 B
YAML

# SPDX-License-Identifier: BSD-3-Clause
---
- name: "** TEST check bond settings"
command: cat
/sys/class/net/{{ controller_device }}/bonding/{{ bond_opt.key | quote }}
register: result
until: bond_opt.value in result.stdout
loop: "{{ bond_options_to_assert }}"
loop_control:
loop_var: bond_opt
changed_when: false
- name: Include the task 'assert_IPv4_present.yml'
include_tasks: assert_IPv4_present.yml
vars:
interface: "{{ controller_device }}"
address: '192.0.2'
- name: Include the task 'assert_IPv6_present.yml'
include_tasks: assert_IPv6_present.yml
vars:
interface: "{{ controller_device }}"
address: '2001'