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

Add Ansible yamllint #192

Merged
merged 1 commit into from
Nov 24, 2023
Merged

Add Ansible yamllint #192

merged 1 commit into from
Nov 24, 2023

Conversation

mpagot
Copy link
Collaborator

@mpagot mpagot commented Nov 21, 2023

Fix Makefile about all the Ansible targets, they now catch all relevant files.
Fix all the warning reported by yamllint.
Add a github action to lint the Ansible code with yamllint.

Ticket : TEAM-7184

Verification: is the pipeline execution in this PR

@mpagot mpagot marked this pull request as ready for review November 21, 2023 18:08
Makefile Outdated Show resolved Hide resolved
Copy link
Collaborator

@BillAnastasiadis BillAnastasiadis left a comment

Choose a reason for hiding this comment

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

LGTM

Makefile Outdated

static-ansible-syntax:
@find ansible/playbooks -type f -iname "*.yaml" -maxdepth 1 -exec ansible-playbook -l all -vvvv -i terraform/azure/inventory.yaml --syntax-check {} +
@find ansible/playbooks/ -type f -iname "*.yaml" -and ! -name "registration_role.yaml" -maxdepth 1 -exec ansible-playbook -l all -vvvv -i terraform/azure/inventory.yaml --syntax-check {} +
Copy link
Collaborator

Choose a reason for hiding this comment

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

The other check (the one in static-ansible-yaml) calls a script with only one find (and some variables). Wouldn't it make sense to also turn this check into a script in tools/?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I decided to focus this PR on yamllint and leave all the work about ansible-playbook ``syntax-check for a next PR. Yes I agree it make sense to move this one too to a dedicated script.

Copy link
Collaborator

@alvarocarvajald alvarocarvajald left a comment

Choose a reason for hiding this comment

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

LGTM. Just a question.

Fix Makefile about all the Ansible targets, they now catch all relevant
files.
Fix all the warning reported by yamllint.
Add a github action to lint the Ansible code with yamllint.
@mpagot mpagot merged commit 9eb8dc5 into SUSE:main Nov 24, 2023
8 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.

3 participants