Skip to content

Add Ansible yamllint#192

Merged
mpagot merged 1 commit intoSUSE:mainfrom
mpagot:ansible_lint_fix
Nov 24, 2023
Merged

Add Ansible yamllint#192
mpagot merged 1 commit intoSUSE:mainfrom
mpagot:ansible_lint_fix

Conversation

@mpagot
Copy link
Copy Markdown
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
Comment thread Makefile Outdated
Copy link
Copy Markdown
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

Comment thread 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.
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