]> arthur.barton.de Git - AnsibleRoles.git/commitdiff
check-mk-agent: "nagios-plugins-basic" is "monitoring-plugins-basic" since Debian... master
authorAlexander Barton <alex@barton.de>
Thu, 28 May 2020 15:24:18 +0000 (17:24 +0200)
committerAlexander Barton <alex@barton.de>
Thu, 28 May 2020 15:24:18 +0000 (17:24 +0200)
README.md
roles/check-mk-agent/tasks/main.yml
roles/debian-base/tasks/main.yml
roles/linux-zfs/tasks/main.yml
roles/linux-zfs/templates/cron.d_zpool-scrub.j2 [deleted file]
roles/linux-zfs/templates/zpool-scrub.sh.j2 [deleted file]

index 6d64b5f20b1b7c3180915851b7fa36ed5d04e2ad..475730cfb1d9b8bc7b2b2afa4c07c5478257cb3c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -75,7 +75,7 @@ directory hierarchy.
 
  - check-mk-agent
  - check-mk-agent-logwatch
 
  - check-mk-agent
  - check-mk-agent-logwatch
- - nagios-plugins-basic
+ - monitoring-plugins-basic
 
 
 ### debian-base
 
 
 ### debian-base
index 950946cdaffb0342b94f48968c620b81bb16114a..988ad3fc22b37d5e55ff2bf59e38b3249687e4a3 100644 (file)
@@ -10,7 +10,7 @@
     state: present
     name: [
       'check-mk-agent',
     state: present
     name: [
       'check-mk-agent',
-      'nagios-plugins-basic',
+      'monitoring-plugins-basic',
     ]
 
 - name: install Debian packages for Check_MK agent (2/2)
     ]
 
 - name: install Debian packages for Check_MK agent (2/2)
index 199cf46d72388a18754a293ab0ee3ad50a7cc7f5..38b56193402657c85ba4b6b0723a280bda848b79 100644 (file)
       'net-tools',
       'screen',
       'sudo',
       'net-tools',
       'screen',
       'sudo',
-      'telnet-ssl',
       'vim',
     ]
 
       '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
 - name: install common packages (non Proxmox-VE hosts)
   tags:
     - packages
index cf4b83492dd05632db3be853ecb7b80fdd60fb1e..6e6e79d1aed6df2558e1a396e56ddc9ea070f93a 100644 (file)
     state=present
     name=zfsutils
 
     state=present
     name=zfsutils
 
-- name: setup /usr/local/sbin/zpool-scrub.sh file
+- name: remove outdated zpool-scrub configuration
   tags:
     - zfs
   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
     - 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 (file)
index 1cdfaec..0000000
+++ /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 (file)
index 9ee29d1..0000000
+++ /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