Skip to content
Snippets Groups Projects
Commit df13c147 authored by nimrod's avatar nimrod
Browse files

- First commit.

parents
Branches
No related tags found
No related merge requests found
*~
~*
*.swp
*.swo
.DS_Store
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: cf550fcab3f12015f8676b8278b30e1a5bc10e70
hooks:
- id: check-added-large-files
- id: check-json
- id: check-xml
- id: check-yaml
- id: check-merge-conflict
- id: flake8
This diff is collapsed.
Ansible pre-commit hook
#######################
Ansible `pre-commit <http://pre-commit.com/>`_ hook. The hook runs
:code:`ansible --syntax-check` against playbooks found.
Usage
-----
Add the following to your :code:`.pre-commit-config.yaml`:
.. :code: yaml
- repo: https://www.shore.co.il/git/ansible-pre-commit/
sha: v0.1.0
hooks:
- id: ansible-pre-commit
files: playbook.yml
0.1.0
#!/bin/sh -e
for playbook in $@
do
ANSIBLE_ROLES_PATH=../ ansible-playbook \
--inventory=localhost, \
--syntax-check "$playbook"
done
---
- id: ansible-pre-commit
name: Check Ansible playbooks
description: Check Ansible playbooks for syntax errors.
langauge: script
entry: ansible-pre-commit
files: \.(sh|bash)$
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment