diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2025-01-31 14:04:25 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2025-01-31 14:05:36 +0100 |
commit | 16fc7a62c6873cd0c06a63bc7b37247534f0c72e (patch) | |
tree | 3536933d7c380778467865f565ea9439f9c7f9bf | |
parent | fe4dc3a1773dab09d4f66a9e4acf83846bb8a823 (diff) | |
download | itzks-systems-16fc7a62c6873cd0c06a63bc7b37247534f0c72e.tar.gz itzks-systems-16fc7a62c6873cd0c06a63bc7b37247534f0c72e.tar.bz2 itzks-systems-16fc7a62c6873cd0c06a63bc7b37247534f0c72e.zip |
sbin/itzks-puppetserver-detect-broken-hosts: Add support for ignoring already repaired puppet clients.
-rw-r--r-- | debian/itzks-systems-puppetserver.install | 1 | ||||
-rw-r--r-- | etc/debian-edu/itzks-puppetserver-fixed-puppet-hosts | 6 | ||||
-rwxr-xr-x | sbin/itzks-puppetserver-detect-broken-hosts | 9 |
3 files changed, 16 insertions, 0 deletions
diff --git a/debian/itzks-systems-puppetserver.install b/debian/itzks-systems-puppetserver.install index ba14913..06b07a8 100644 --- a/debian/itzks-systems-puppetserver.install +++ b/debian/itzks-systems-puppetserver.install @@ -1,4 +1,5 @@ etc/cron.d/itzks-systems-puppetserver +etc/debian-edu/itzks-puppetserver-fixed-puppet-hosts sbin/itzks-puppetserver-autosign-new-host-certificates usr/sbin/ sbin/itzks-puppetserver-clean-hosts-from-ca usr/sbin/ sbin/itzks-puppetserver-detect-broken-hosts usr/sbin/ diff --git a/etc/debian-edu/itzks-puppetserver-fixed-puppet-hosts b/etc/debian-edu/itzks-puppetserver-fixed-puppet-hosts new file mode 100644 index 0000000..09b7ed1 --- /dev/null +++ b/etc/debian-edu/itzks-puppetserver-fixed-puppet-hosts @@ -0,0 +1,6 @@ +# When diagnosing host sign-ups in puppetserver via the itzks-puppetserver-detect-broken-hosts script, +# put all already fixed systems into this file so they get ignored when re-scanning puppetserver logs +# with above named script. +# +# Example: +#pc-12.intern diff --git a/sbin/itzks-puppetserver-detect-broken-hosts b/sbin/itzks-puppetserver-detect-broken-hosts index ad13ea7..a632c52 100755 --- a/sbin/itzks-puppetserver-detect-broken-hosts +++ b/sbin/itzks-puppetserver-detect-broken-hosts @@ -26,6 +26,11 @@ usage() { exit 1 } +ignore_repaired_hosts="" +if [ -e /etc/debian-edu/itzks-puppetserver-fixed-puppet-hosts ]; then + ignore_repaired_hosts=$(cat /etc/debian-edu/itzks-puppetserver-fixed-puppet-hosts | grep -v -E "^#.*") +fi + for arg in "$@"; do case "${arg}" in -t|--today) @@ -66,6 +71,10 @@ for ip in ${iplist_with_puppeterrors}; do continue fi + if [ -n "${fqdn}" ] && echo "${ignore_repaired_hosts}" | grep -q "${fqdn}"; then + continue + fi + if [[ -n "${INCLUDE}" ]] && ! echo "${ip} ${fqdn}" | grep -q -E "${INCLUDE}"; then continue fi |