]> git.phdru.name Git - ansible.git/commitdiff
Feat(logcheck): Add `logcheck.sh`
authorOleg Broytman <phd@phdru.name>
Sat, 27 Jan 2024 22:11:45 +0000 (01:11 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 27 Jan 2024 22:11:45 +0000 (01:11 +0300)
Check the tree is git-clean
and sync it to the remote hosts.

playbooks/logcheck.sh [new file with mode: 0755]

diff --git a/playbooks/logcheck.sh b/playbooks/logcheck.sh
new file mode 100755 (executable)
index 0000000..05a9d09
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/sh
+set -e
+cd "`dirname \"$0\"`"
+
+git update-index -q --refresh
+if ! git diff-index --quiet HEAD || test -n "`git ls-files --others`" ; then
+    echo "The tree is dirty, aborting..." >&2
+    exit 1
+fi
+
+(cd ../.. && exec distribute -aD ansible)
+exec ./run-playbook logcheck.yaml