-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conversation
ff62ee2
to
62bf1e1
Compare
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.
62bf1e1
to
4cabc2e
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
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