fix few small bugs #160
8 changed files with 15 additions and 27 deletions
|
@ -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 }}"
|
||||
|
|
|
@ -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') }}"
|
||||
|
|
|
@ -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:
|
||||
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
...
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
|
|
@ -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 }}
|
|
@ -19,6 +19,16 @@
|
|||
deb: "{{ sanoid_deb_url }}"
|
||||
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
|
||||
mode: '0755'
|
||||
owner: root
|
||||
group: root
|
||||
force: true
|
||||
|
||||
- name: create sanoid directories
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in a new issue