From 8b2b16659cfbfac3ad7adb6abcd1e9c881f9b8d2 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 19 Aug 2024 22:51:22 +0200 Subject: [PATCH 01/12] ff --- roles/mgrote_zfs_sanoid/templates/syncoid.sh.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mgrote_zfs_sanoid/templates/syncoid.sh.j2 b/roles/mgrote_zfs_sanoid/templates/syncoid.sh.j2 index 6394ffae..68b2f752 100644 --- a/roles/mgrote_zfs_sanoid/templates/syncoid.sh.j2 +++ b/roles/mgrote_zfs_sanoid/templates/syncoid.sh.j2 @@ -8,5 +8,5 @@ # check if source host is reachable ping -c1 -W1 {{ item.source_host }} > /dev/null || {{ item.source_host }} not reachable! # syncoid -export HOME=/root ; /usr/bin/syncoid --compress=zstd-fast --sshoption=StrictHostKeyChecking=no --delete-target-snapshots --use-hold --preserve-recordsize --sshkey "/etc/sanoid/.ssh/id_sanoid" --source-bwlimit {{ sanoid_syncoid_bwlimit }} {{ sanoid_user }}@{{ item.source_host }}:{{ item.source_dataset }} {{ item.destination_dataset }} 2> /dev/null +export HOME=/root ; /usr/bin/syncoid --compress=zstd-fast --sshoption=StrictHostKeyChecking=no --delete-target-snapshots --use-hold --preserve-recordsize --sshkey "/etc/sanoid/.ssh/id_sanoid" --source-bwlimit {{ sanoid_syncoid_bwlimit }} {{ sanoid_user }}@{{ item.source_host }}:{{ item.source_dataset }} {{ item.destination_dataset }} {% endfor %} -- 2.43.0 From 3b4ceba56dea2d6c6b2bcc02722fe3b708c9f33e Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 19 Aug 2024 23:07:10 +0200 Subject: [PATCH 02/12] d --- roles/mgrote_users/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/mgrote_users/tasks/main.yml b/roles/mgrote_users/tasks/main.yml index 28c0d77a..a86703cf 100644 --- a/roles/mgrote_users/tasks/main.yml +++ b/roles/mgrote_users/tasks/main.yml @@ -4,6 +4,7 @@ groups_as_list: "{{ (groups_as_list | default([]) + item.groups.split(',')) | map('trim') | list | sort | unique }}" loop: '{{ users }}' when: item.groups is defined + ignore_errors: true - name: create groups ansible.builtin.group: -- 2.43.0 From e6114dd7b7f200705a24c9461fc6d111375b0933 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 19 Aug 2024 23:14:26 +0200 Subject: [PATCH 03/12] dd --- group_vars/munin.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/group_vars/munin.yml b/group_vars/munin.yml index 25b109ae..83388801 100644 --- a/group_vars/munin.yml +++ b/group_vars/munin.yml @@ -42,6 +42,7 @@ munin_node_bind_port: "4949" munin_node_allowed_cidrs: [127.0.0.1] ### mgrote_munin_master +munin_mode: cron # or cgi munin_mail_user: munin@mgrote.net munin_mail_server: "{{ postfix_smtp_server }}" munin_mail_port: "{{ 1025 }}" -- 2.43.0 From 134ad553899270f2adecdae8da60ce14c5498cf6 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 19 Aug 2024 23:19:04 +0200 Subject: [PATCH 04/12] dd --- roles/mgrote_munin_server/defaults/main.yml | 2 +- roles/mgrote_munin_server/templates/munin.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/mgrote_munin_server/defaults/main.yml b/roles/mgrote_munin_server/defaults/main.yml index 13509f1e..3cabb5c7 100644 --- a/roles/mgrote_munin_server/defaults/main.yml +++ b/roles/mgrote_munin_server/defaults/main.yml @@ -6,12 +6,12 @@ munin_packages: - wget - libapache2-mod-fcgid - libcgi-fast-perl - - ssmtp - perl - mailutils - curl - tzdata - munin-node + - s-nail - libfile-readbackwards-perl munin_servername: "{{ ansible_fqdn }}.mgrote.net" munin_dirs: diff --git a/roles/mgrote_munin_server/templates/munin.conf b/roles/mgrote_munin_server/templates/munin.conf index 1d8effa0..5924073b 100644 --- a/roles/mgrote_munin_server/templates/munin.conf +++ b/roles/mgrote_munin_server/templates/munin.conf @@ -91,7 +91,7 @@ html_strategy {{ munin_mode }} # something changes (OK -> WARNING, CRITICAL -> OK, etc) # test with: sudo -u munin /usr/share/munin/munin-limits --contact someuser --force {% if munin_enable_alerts is sameas true %} -contact.someuser.command mail -aFROM:munin@mgrote.net -s "Munin ${var:worst}: ${var:group}::${var:host}::${var:plugin}" {{ munin_alerts_to }} +contact.someuser.command s-nail --set=from='munin@mgrote.net' -s "Munin ${var:worst}: ${var:group}::${var:host}::${var:plugin}" {{ munin_alerts_to }} {% endif %} #contact.anotheruser.command mail -s "Munin ${var:worst}: ${var:group}::${var:host}::${var:plugin}" anotheruser@blibb.comm # -- 2.43.0 From 34b300075515d983f930d81b0610aa4219df3c7d Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 19 Aug 2024 23:19:50 +0200 Subject: [PATCH 05/12] ff --- roles/mgrote_munin_server/templates/munin.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/mgrote_munin_server/templates/munin.conf b/roles/mgrote_munin_server/templates/munin.conf index 5924073b..192484bb 100644 --- a/roles/mgrote_munin_server/templates/munin.conf +++ b/roles/mgrote_munin_server/templates/munin.conf @@ -111,5 +111,4 @@ contact.someuser.command s-nail --set=from='munin@mgrote.net' -s "Munin ${var:wo {{ extra }} {% endfor %} {% endif %} - {% endfor %} -- 2.43.0 From f14e2a9db15cc9c1d53028dc199f4cad2dab05a4 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 19 Aug 2024 23:27:48 +0200 Subject: [PATCH 06/12] dd --- host_vars/pbs.mgrote.net.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/host_vars/pbs.mgrote.net.yml b/host_vars/pbs.mgrote.net.yml index 85e84a22..f9315299 100644 --- a/host_vars/pbs.mgrote.net.yml +++ b/host_vars/pbs.mgrote.net.yml @@ -68,6 +68,7 @@ zfs_extra_zfs_pools: ### mgrote_zfs_sanoid sanoid_snaps_enable: true + ## syncoid sanoid_syncoid_destination_host: true sanoid_syncoid_ssh_privkey: "{{ lookup('viczem.keepass.keepass', 'sanoid_syncoid_private_key', 'notes') }}" -- 2.43.0 From 6b355e679081c3482ca374657e429a953284e6dc Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 19 Aug 2024 23:29:55 +0200 Subject: [PATCH 07/12] ff --- roles/mgrote_users/tasks/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/mgrote_users/tasks/main.yml b/roles/mgrote_users/tasks/main.yml index a86703cf..28c0d77a 100644 --- a/roles/mgrote_users/tasks/main.yml +++ b/roles/mgrote_users/tasks/main.yml @@ -4,7 +4,6 @@ groups_as_list: "{{ (groups_as_list | default([]) + item.groups.split(',')) | map('trim') | list | sort | unique }}" loop: '{{ users }}' when: item.groups is defined - ignore_errors: true - name: create groups ansible.builtin.group: -- 2.43.0 From 115d364d36e1e57d213ca726b7be442f651e9a63 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 19 Aug 2024 23:32:58 +0200 Subject: [PATCH 08/12] d --- roles/mgrote_munin_server/defaults/main.yml | 4 ---- roles/mgrote_munin_server/tasks/main.yml | 8 -------- roles/mgrote_munin_server/templates/ssmtp.conf | 12 ------------ 3 files changed, 24 deletions(-) delete mode 100644 roles/mgrote_munin_server/templates/ssmtp.conf diff --git a/roles/mgrote_munin_server/defaults/main.yml b/roles/mgrote_munin_server/defaults/main.yml index 3cabb5c7..494f7465 100644 --- a/roles/mgrote_munin_server/defaults/main.yml +++ b/roles/mgrote_munin_server/defaults/main.yml @@ -27,10 +27,6 @@ munin_cron_job: present munin_dbdir: "/var/lib/munin" munin_enable_alerts: false -munin_mail_server: mail.server.com -munin_mail_port: 25 -munin_mail_tls: false -munin_alerts_to: nobody@nowhere.com munin_mode: cgi # or cron diff --git a/roles/mgrote_munin_server/tasks/main.yml b/roles/mgrote_munin_server/tasks/main.yml index 7f605c54..0ae1e90a 100644 --- a/roles/mgrote_munin_server/tasks/main.yml +++ b/roles/mgrote_munin_server/tasks/main.yml @@ -75,12 +75,4 @@ owner: munin group: munin when: not placeholder.stat.exists - -- name: Template ssmtp config - ansible.builtin.template: - src: ssmtp.conf - dest: /etc/ssmtp/ssmtp.conf - mode: '0644' - owner: root - group: root ... diff --git a/roles/mgrote_munin_server/templates/ssmtp.conf b/roles/mgrote_munin_server/templates/ssmtp.conf deleted file mode 100644 index 27a5b091..00000000 --- a/roles/mgrote_munin_server/templates/ssmtp.conf +++ /dev/null @@ -1,12 +0,0 @@ -# The user that gets all the mails (UID < 1000, usually the admin) -root={{ munin_alerts_to }} - -# The mail server (where the mail is sent to), both port 465 or 587 should be acceptable -# See also https://support.google.com/mail/answer/78799 -mailhub={{ munin_mail_server }}:{{ munin_mail_port }} - -# The full hostname. Must be correctly formed, fully qualified domain name or GMail will reject connection. -hostname={{ munin_servername }} - -# Use implicit TLS (port 465). When using port 587, change UseSTARTTLS=Yes -UseTLS={{ munin_mail_tls }} -- 2.43.0 From 255ba7672e4ee9627033006e7471576cd3d6ea00 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 19 Aug 2024 23:35:01 +0200 Subject: [PATCH 09/12] dd --- roles/mgrote_munin_server/templates/munin.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/mgrote_munin_server/templates/munin.conf b/roles/mgrote_munin_server/templates/munin.conf index 192484bb..5924073b 100644 --- a/roles/mgrote_munin_server/templates/munin.conf +++ b/roles/mgrote_munin_server/templates/munin.conf @@ -111,4 +111,5 @@ contact.someuser.command s-nail --set=from='munin@mgrote.net' -s "Munin ${var:wo {{ extra }} {% endfor %} {% endif %} + {% endfor %} -- 2.43.0 From 45648dbc6b6add64394d378662b2b44dfa2c5e07 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Tue, 20 Aug 2024 08:51:50 +0200 Subject: [PATCH 10/12] ff --- roles/mgrote_zfs_sanoid/tasks/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/mgrote_zfs_sanoid/tasks/main.yml b/roles/mgrote_zfs_sanoid/tasks/main.yml index 32fce206..4b8e5eaf 100644 --- a/roles/mgrote_zfs_sanoid/tasks/main.yml +++ b/roles/mgrote_zfs_sanoid/tasks/main.yml @@ -19,6 +19,14 @@ deb: "{{ sanoid_deb_url }}" state: present +- name: Overwrite syncoid script from package + ansible.builtin.get_url: + url: https://raw.githubusercontent.com/jimsalterjrs/sanoid/master/syncoid + dest: /usr/bin/syncoid + mode: '0755' + owner: root + group: root + - name: create sanoid directories become: true ansible.builtin.file: -- 2.43.0 From 713f4f287970fc66b58393c470f43eeae50fecf0 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Tue, 20 Aug 2024 08:53:07 +0200 Subject: [PATCH 11/12] dd --- roles/mgrote_zfs_sanoid/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/mgrote_zfs_sanoid/tasks/main.yml b/roles/mgrote_zfs_sanoid/tasks/main.yml index 4b8e5eaf..db033488 100644 --- a/roles/mgrote_zfs_sanoid/tasks/main.yml +++ b/roles/mgrote_zfs_sanoid/tasks/main.yml @@ -26,6 +26,7 @@ mode: '0755' owner: root group: root + force: true - name: create sanoid directories become: true -- 2.43.0 From d39bc18689806da453c4ec3dacc5d9a7304ec76a Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Tue, 20 Aug 2024 08:53:41 +0200 Subject: [PATCH 12/12] dd --- roles/mgrote_zfs_sanoid/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/mgrote_zfs_sanoid/tasks/main.yml b/roles/mgrote_zfs_sanoid/tasks/main.yml index db033488..4e46c86f 100644 --- a/roles/mgrote_zfs_sanoid/tasks/main.yml +++ b/roles/mgrote_zfs_sanoid/tasks/main.yml @@ -20,6 +20,7 @@ state: present - name: Overwrite syncoid script from package + become: true ansible.builtin.get_url: url: https://raw.githubusercontent.com/jimsalterjrs/sanoid/master/syncoid dest: /usr/bin/syncoid -- 2.43.0