Commit graph

4 commits

Author SHA1 Message Date
Rich Megginson
65e74567d4 refactor: support Ansible 2.19
The big problem was trying to use `vars` with `import_playbook`.

We do not need to use `import_playbook` when `include_tasks` will
work.  Perhaps the original author of these tests thought that
the play `roles` keyword was the only way to invoke roles, so
that had to be "called" using an `import_playbook`?

Use `include_tasks` instead of `import_playbook`, and move some
of those "tasks" playbooks to be tasks files in tests/tasks.

Use `include_role` instead of `import_role`.

Do not set variables using `set_fact` if they have already been
set at the appropriate scope using `vars`.

"Modernize" the code somewhat.

Improve formatting.

Work around an Ansible bug https://github.com/ansible/ansible/issues/85394

Fix ansible-lint and ansible-test issues related newer versions of
those tools.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-07-02 14:42:43 -06:00
Wen Liang
d6203012e5 docs: Explain where network state examples originate
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2024-09-06 10:21:44 -04:00
Wen Liang
7a476a71a4 docs: Remove invalid network state example
For an ethernet device which contains the kernel link, we should not
and cannot delete such a device using `network_state` variable.

We can only use `network_state` variable to delete the virtual NIC that
is created by NM/Nmstate.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2024-08-28 08:23:40 -04:00
Wen Liang
7dca20df3c docs: Add examples using network_state variable
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2024-08-22 11:44:01 -04:00