Skip to content

Instantly share code, notes, and snippets.

@tmepple
tmepple / pre-commit.example
Last active February 3, 2018 22:11 — forked from ralovely/pre-commit.example
Git pre-commit hook for Ansible Vault
#!/bin/sh
#
# Pre-commit hook that verifies if all files containing 'vault' in the name
# are encrypted.
# If not, commit will fail with an error message
#
# File should be .git/hooks/pre-commit and executable
FILES_PATTERN='.*vault.*\.yml$'
REQUIRED='ANSIBLE_VAULT'