9 Commits

Author SHA1 Message Date
Rafael Guterres Jeffman
5b33cb5e80 Remove molecule dependencies
For some time now, we had some issues with molecule when building test
images for ansible-freeipa, and replaced the image creation with custom
build scripts that use commom container tools (like Dockerfiles and the
build command).

As there's no more tasks that require the use of molecule, this patch
removes the last bits used by it, and fixes documentation and lint
scripts and configuration.
2024-10-31 11:06:41 -03:00
Rafael Guterres Jeffman
306522acd8 upstream CI: Disable ansible-lint var-naming check
Latest ansible-lint version (6.16.1) started to raise an error when
variable names from within roles are not prefixed with  the role name.
Error: var-naming[no-role-prefix].

As Ansible sanity check does not enforce this, it will be disabled, for
now on ansible-freeipa's upstream CI.

A future effort to reduce the checks that are not being evaluated should
be done as preparation for future Ansible Galaxy and Automation Hub
requirements.
2023-05-16 16:08:51 -03:00
Thomas Woerner
fe6edbabdb .ansible-lint: Deactivate experimental and name[template] tests
The experimental tests is running several additional tests like for
example to check module arg values. It fails everytime a variable is
used to pass the value in.

Examples:
- playbooks/topology/add-topologysegments.yml:15: args[module]: value of
  suffix must be one of: domain, ca, domain+ca, got: {{ item.suffix }}
- tests/host/test_host.yml:21: args[module]: value of ipaapi_context must
  be one of: server, client, got: {{ ipa_context | default(omit) }}

The name template test is failing for every template use inside of a name.
This is forcing to have only generic names and nothing specific in the
log anymore.

These two tests have been deactivated to have less overflow in the
ansible-lint output.
2023-01-17 11:20:10 +01:00
Rafael Guterres Jeffman
529deae407 ansible-lint: Fix file kind and ignores.
ansible-lint must ignore Azure configuration, and handle non-test files
with the proper kind (tasks or playbook).
2023-01-12 13:21:52 -03:00
Rafael Guterres Jeffman
7e6e6c2dc2 run-tests: Run tests locally with upstream CI images
This patch allows local execution of playbook tests using ustream CI
testing images. Either 'podman' or 'docker' can be used to execute the
tests.
2022-08-29 18:13:30 -03:00
Rafael Guterres Jeffman
0efe2c30d2 ansible-lint: Identify env_*.yml and tasks_*.yml as task files.
Failing to identify task files included by playbooks raised false
positives when runnnig ansible lint. This change force ansible-lint to
correctly identify YAML files named "env_*.yml" or "tasks_*.yml" as task
files that are imported by other playbooks, and treat them accordingly.
2022-04-25 10:58:16 -03:00
Rafael Guterres Jeffman
e069395ba0 Make ansible-lint and yamllint use more strict rules.
This patch modifies configuration of both ansible-lint and yamllint
to check for more rules, resulting in a more strict verification.

For ansible-lint verification of errors 301, 305 and 505 are skipped,
due to false positives. For the same reason, 'experimental' rules
are skipped.

ansible-lint error 306 is skipped since the fix is to set pipefail,
which is not available in all shells (for example dash, which runs
ansible-freeipa CI).

Yamllint disabled rules (comments, and indentation) would introduce a
huge amount of small changes, and are left for future changes, it
deemed necessary.
2021-09-29 15:49:00 -03:00
Rafael Guterres Jeffman
82b5857960 ansible-lint: Add paths and files to exclude list.
Some YAML files used in the project are not Ansible playbooks and
should not be evaluated by ansible-lint. This change add the paths
and files that should not be evaluated to an exclude list, that
affects linter operations in CI and pre-commit scripts.
2021-08-24 10:33:19 -03:00
Rafael Guterres Jeffman
b8398c4737 Enable ansible-lint Github action on every push.
By running ansible-lint we check if playbooks provided in
ansible-freipa follow Ansible's best practices, nd the verification
will be performed on every push (even on forks) or pull-request.

This patch provides the configuration needed to run ansible-lint
to the playbooks found in the `tests`, `playbooks` and `molecule`
directories, on every push or pull-request done on Github, using
Ansible's Github Action ansible/ansible-lint-action.
2020-09-01 16:58:02 -03:00