https://github.com/wikimedia/operations-puppet
Revision 7ecc9443bb3a427dbb91753dcd5e94aa5f4374b3 authored by RobH on 08 September 2014, 22:06:43 UTC, committed by RobH on 08 September 2014, 22:06:43 UTC
setting the lease info for db2001-2031. skipping db2020 for db.cfg
partman as it has a disk shelf, will come back to it later.

updating the db.cfg raid recipie per ticket, as all future db installs
should do /srv mount rather than /a.

Change-Id: I5096337e1dc2f3ad8c75d7552d48ff8b0e3c9bae
RT: 8297
1 parent 374dacb
Raw File
Tip revision: 7ecc9443bb3a427dbb91753dcd5e94aa5f4374b3 authored by RobH on 08 September 2014, 22:06:43 UTC
setting install params for db2001-2031
Tip revision: 7ecc944
pre-commit-hook
#!/usr/bin/env bash
#
# Git pre-commit hook for Puppet manifests
#
# Validates modified Puppet manifests using "puppet parser validate",
# if available. If not available, outputs warning and continues. If
# available and validation fails, aborts commit.
#
# Author: Ori Livneh


if ! $(hash puppet &>/dev/null) ; then
    echo "WARNING: puppet not found; skipping syntax checks" >&2
    exit 0
fi

# Read names of modified manifests (*.pp files) into a Bash array
mapfile -t diff < <(git diff --cached --name-only --diff-filter=ACM -- '*.pp')

for file in "${diff[@]}"; do
    # Validate; ignore warnings about storeconfigs not being set
    # because it is only set on puppetmaster. Use PIPESTATUS to
    # get the exit status of puppet rather than grep.
    puppet parser validate "${file}" 2>&1 | grep -v "without storeconfigs"
    if [[ ${PIPESTATUS[0]} != 0 ]] ; then
        exit 2
    fi
done
back to top