From 9e448cbdcdd811d7ae0fb6c3564419e6f8144461 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Fri, 17 Jan 2020 11:57:05 +0100 Subject: [PATCH 1/3] linux-zfs: Get rid of "zpool-scrub" config, now included in "zfs-utils" --- roles/linux-zfs/tasks/main.yml | 24 +++------ .../linux-zfs/templates/cron.d_zpool-scrub.j2 | 11 ----- roles/linux-zfs/templates/zpool-scrub.sh.j2 | 49 ------------------- 3 files changed, 7 insertions(+), 77 deletions(-) delete mode 100644 roles/linux-zfs/templates/cron.d_zpool-scrub.j2 delete mode 100644 roles/linux-zfs/templates/zpool-scrub.sh.j2 diff --git a/roles/linux-zfs/tasks/main.yml b/roles/linux-zfs/tasks/main.yml index cf4b834..6e6e79d 100644 --- a/roles/linux-zfs/tasks/main.yml +++ b/roles/linux-zfs/tasks/main.yml @@ -27,23 +27,13 @@ state=present name=zfsutils -- name: setup /usr/local/sbin/zpool-scrub.sh file +- name: remove outdated zpool-scrub configuration tags: - zfs - template: > - dest=/usr/local/sbin/zpool-scrub.sh - group=root - mode=0755 - owner=root - src=zpool-scrub.sh.j2 - -- name: setup /etc/cton.d/zpool-scrub file - tags: - cron - - zfs - template: > - dest=/etc/cron.d/zpool-scrub - group=root - mode=0644 - owner=root - src=cron.d_zpool-scrub.j2 + file: + state: absent + path: "{{ item }}" + with_items: + - /usr/local/sbin/zpool-scrub.sh + - /etc/cron.d/zpool-scrub diff --git a/roles/linux-zfs/templates/cron.d_zpool-scrub.j2 b/roles/linux-zfs/templates/cron.d_zpool-scrub.j2 deleted file mode 100644 index 1cdfaec..0000000 --- a/roles/linux-zfs/templates/cron.d_zpool-scrub.j2 +++ /dev/null @@ -1,11 +0,0 @@ -# /etc/cron.d/zpool-scrub -# --- -# {{ ansible_managed }} -# --- - -PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin/:/bin -MAILTO={{ admin_email }} - -# m h dom mon dow user command - -{{ zfs_scrub_minute }} {{ zfs_scrub_hour }} * * {{ zfs_scrub_dayofweek }} root /usr/local/sbin/zpool-scrub.sh diff --git a/roles/linux-zfs/templates/zpool-scrub.sh.j2 b/roles/linux-zfs/templates/zpool-scrub.sh.j2 deleted file mode 100644 index 9ee29d1..0000000 --- a/roles/linux-zfs/templates/zpool-scrub.sh.j2 +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# /usr/local/sbin/backup-script-wrapper -# --- -# {{ ansible_managed }} -# --- - -NAME=$(basename "$0") - -pools=$(zpool list -H | cut -f1) -if [ $? -ne 0 ]; then - echo "$NAME: Failed to list ZFS pools, aborting!" - exit 1 -fi -if [ -z "$pools" ]; then - # No pools found, nothing to do, ok. - exit 0 -fi - -wait_for_scrub_done() { - while true; do - zpool status "$1" 2>/dev/null | fgrep 'scrub in progress' >/dev/null - [ $? -eq 0 ] || return 0 - sleep 60 - done -} - -echo "Scrubbing ZFS storage pools on $(hostname -f):" -echo - -zpool list -echo - -for pool in $pools; do - echo "Scrubbing ZFS storage pool \"$pool\" ..." - echo -n "Started: "; date - zpool scrub "$pool" - if [ $? -eq 0 ]; then - wait_for_scrub_done "$pool" - echo -n "Done: "; date - else - echo "Failed to start scrubbing!?" - zpool scrub -s "$pool" >/dev/null 2>&1 - sleep 5 - fi - echo -done - -# Show status of ZFS storage pools -zpool status -- 2.39.2 From 9038a104186e814d643cd4e159558045621a8335 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Thu, 28 May 2020 14:55:42 +0200 Subject: [PATCH 2/3] debian-base: "telnet-ssl" is no longer available on Debian 10 So only install it on Debian < 10 systems, and install "telnet" on Debian >= 10 ... --- roles/debian-base/tasks/main.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/roles/debian-base/tasks/main.yml b/roles/debian-base/tasks/main.yml index 199cf46..38b5619 100644 --- a/roles/debian-base/tasks/main.yml +++ b/roles/debian-base/tasks/main.yml @@ -21,10 +21,29 @@ 'net-tools', 'screen', 'sudo', - 'telnet-ssl', 'vim', ] +- name: install common packages for Debian <10 + tags: + - packages + apt: + state: present + name: [ + 'telnet-ssl', + ] + when: "ansible_distribution_major_version|int < 10" + +- name: install common packages for Debian >= 10 + tags: + - packages + apt: + state: present + name: [ + 'telnet', + ] + when: "ansible_distribution_major_version|int >= 10" + - name: install common packages (non Proxmox-VE hosts) tags: - packages -- 2.39.2 From 27d78f7a9ec46ee71b6b6ed8d914f67ebce7062c Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Thu, 28 May 2020 17:24:18 +0200 Subject: [PATCH 3/3] check-mk-agent: "nagios-plugins-basic" is "monitoring-plugins-basic" since Debian 7 ... --- README.md | 2 +- roles/check-mk-agent/tasks/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d64b5f..475730c 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ directory hierarchy. - check-mk-agent - check-mk-agent-logwatch - - nagios-plugins-basic + - monitoring-plugins-basic ### debian-base diff --git a/roles/check-mk-agent/tasks/main.yml b/roles/check-mk-agent/tasks/main.yml index 950946c..988ad3f 100644 --- a/roles/check-mk-agent/tasks/main.yml +++ b/roles/check-mk-agent/tasks/main.yml @@ -10,7 +10,7 @@ state: present name: [ 'check-mk-agent', - 'nagios-plugins-basic', + 'monitoring-plugins-basic', ] - name: install Debian packages for Check_MK agent (2/2) -- 2.39.2