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 playbook syntax check #193

Merged
merged 1 commit into from
Nov 27, 2023
Merged

Conversation

mpagot
Copy link
Collaborator

@mpagot mpagot commented Nov 24, 2023

Call ansible-playbook for each playbook using --syntax-check.
Dummy roles and inventory is provided to avoid false error detection.
The python script also format the error output to be compliant to github pipeline standard.
Add Github pipeline to run this test.

Ticket : TEAM-7184

Verification: is the pipeline execution in this PR

Here how an error will looks like
image

@mpagot mpagot marked this pull request as ready for review November 24, 2023 16:09
Call ansible-playbook for each playbook using --syntax-check.
Dummy roles and inventory is provided to avoid false error detection.
The python script also format the error output to be compliant to github
pipeline standard.
Add Github pipeline to run this test.
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

@@ -12,7 +12,12 @@ jobs:
- name: Install all requirements
run: |
python3 -m pip install --upgrade -r requirements.txt
ansible-galaxy install -r requirements.yml
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What is interesting is that calling ansible-playbook also need al Ansible dependency to be ok. So this test is also an indirect test for the Ansible dependency.

@@ -3,7 +3,7 @@ venv/
**/.venv/
**/__pycache__/
secret/
inventory.yaml
terraform/**/inventory.yaml
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Needed not to ignore the dummy inventory in the tools folder

@mpagot mpagot merged commit eb0c8bf into SUSE:main Nov 27, 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.

2 participants