Commit graph

6 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
5ff1189409 ansible-lint: Fix name[missing] and name[play] failures
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-04-10 17:49:07 +02:00
Rich Megginson
2b17fe73e9 support playbooks which use gather_facts: false
Some users prefer to use `gather_facts: false` in their playbooks.
However, the network role requires certain ansible_facts to be set.  If
the user wants to use the network role with `gather_facts: false`, the
role will gather the minimum subset of facts required.  If the user does
not want the role to gather facts, the user can either not use the
network role, or ensure that all required facts are in the facts cache.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2022-04-27 23:01:00 +02:00
Gris Ge
b0f5d6352a test: Fix EL6 repo
* As EPEL6 has been moved to archive, created `tests/tasks/enable_epel.yml`.
 * As CentOS6 has been moved to vault, created `tests/tests_00_setup.yml`.

Signed-off-by: Gris Ge <fge@redhat.com>
2020-12-22 08:14:39 +08:00
Elvira Garcia Ruiz
4753c70c55 library: Separate debug and info logs from warnings
Logs are now separed by severity level. Warnings and failures are the only logs
that appear now on the output. All logs are saved into a new json parameter
called "stderr" that is later shown on a different task. In case of
failure, all logs are shown as output. Tests have been created and modified in
order to assure that this feature works.

Signed-off-by: Elvira Garcia Ruiz <elviragr@riseup.net>
2020-05-06 21:57:34 +02:00
Till Maas
4ead3cfea8 Move tests to /tests directory and rename to new naming scheme
Ansible Galaxy and
https://fedoraproject.org/wiki/CI/Standard_Test_Interface suggest to use
a /tests directory and a names matching test*.yml.
2018-05-16 19:48:23 +02:00
Renamed from test/test_default.yml (Browse further)