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

Task validation fixes and rewrites (by Steampunk Spotter) #437

Merged
merged 3 commits into from
Sep 15, 2023

Conversation

anzoman
Copy link
Contributor

@anzoman anzoman commented Sep 15, 2023

Overall Review of Changes:
These changes will try to correct some errors and incorporate multiple hints within Ansible tasks that I have encountered when running some checks with Steampunk Spotter.

Enhancements:
The first change fixes the following error detected by the Spotter CLI:

(.venv) user@ubuntu:~/UBUNTU22-CIS$ spotter scan --ansible-version 2.12 --display-level error .
Scanning...success. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
------------------------------------------------------------------------
tasks/fix-cat2.yml:1108:9: ERROR: [E001] with_items is not a valid parameter in module ansible.builtin.package.
tasks/prelim.yml:55:9: ERROR: [E005] state is a required parameter in module ansible.builtin.package.
tasks/prelim.yml:148:3: ERROR: [E005] state is a required parameter in module ansible.builtin.package.
tasks/prelim.yml:210:3: ERROR: [E005] state is a required parameter in module ansible.builtin.package.
tasks/prelim.yml:282:3: ERROR: [E005] state is a required parameter in module ansible.builtin.package.
tasks/prelim.yml:310:3: ERROR: [E005] state is a required parameter in module ansible.builtin.package.
tasks/prelim.yml:384:3: ERROR: [E005] state is a required parameter in module ansible.builtin.package.
tasks/prelim.yml:399:9: ERROR: [E005] state is a required parameter in module ansible.builtin.package.
------------------------------------------------------------------------
Spotter took 2.798 s to scan your input.
It resulted in 7 error(s), 151 warning(s) and 122 hint(s).
Overall status: ERROR

I've also used Spotter's rewrite feature (--rewrite) to correct a bad practice of inline passing of parameters to modules and replaced that with exact parameters.

How has this been tested?:
N/A

Signed-off-by: Anže Luzar <anze.luzar@xlab.si>
Signed-off-by: Anže Luzar <anze.luzar@xlab.si>
Signed-off-by: Anže Luzar <anze.luzar@xlab.si>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on opening your first pull request and thank you for taking the time to help improve Ansible-Lockdown!
Please join in the conversation happening on the Discord Server as well.

Copy link
Member

@uk-bolly uk-bolly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice changes

@uk-bolly uk-bolly merged commit b53d7be into ansible-lockdown:devel Sep 15, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants