Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible Linting #747

Closed
willifehler opened this issue Feb 16, 2024 · 2 comments
Closed

Ansible Linting #747

willifehler opened this issue Feb 16, 2024 · 2 comments

Comments

@willifehler
Copy link

willifehler commented Feb 16, 2024

Description

The Ansible roles should be linted.

example:

1423 yaml[comments]: Too few spaces before comment 1424 collections/ansible_collections/devsec/hardening/roles/ssh_hardening/defaults/main.yml:109 finffine

Solution

Use https://github.com/ansible/ansible-lint and https://github.com/adrienverge/yamllint to lint all roles.

Alternatives

/

Additional information

...
/

@rndmh3ro
Copy link
Member

We already use ansible-lint in our pipelines. See here: https://github.com/dev-sec/ansible-collection-hardening/actions/runs/7820808401/job/21336340707

Do you use an older version of the collection?

@schurzi
Copy link
Contributor

schurzi commented Feb 16, 2024

We are actually already using ansible-lint, see:
https://github.com/dev-sec/ansible-collection-hardening/blob/master/.github/workflows/ansible-lint.yml
https://github.com/dev-sec/ansible-collection-hardening/actions/runs/7820808401/job/21336340707

And ansible-lint defines the spaces before comments to 1:
https://github.com/ansible/ansible-lint/blob/7849f27453fe1d9c29a43c71cff8f5b666bd43b6/src/ansiblelint/yaml_utils.py#L54

So this seems like a local issue from your setup. Maybe you have a separate config in your project/home?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants