Skip to content
Snippets Groups Projects
Commit a846ca19 authored by Jens Steidl's avatar Jens Steidl :baby_chick:
Browse files

feat: added (maintenance) timers for nfs timeout notifications

parent f961b5b6
No related branches found
No related tags found
No related merge requests found
Pipeline #10560 failed
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
loop: loop:
- "nfs_timeout_notification.service.sh" - "nfs_timeout_notification.service.sh"
- name: install NFS monitoring services (2/3) - copy service unit - name: install NFS monitoring services (2/3) - copy service units & timers
ansible.builtin.template: ansible.builtin.template:
src: "usr/local/lib/systemd/system/{{ item }}.j2" src: "usr/local/lib/systemd/system/{{ item }}.j2"
dest: "/usr/local/lib/systemd/system/{{ item }}" dest: "/usr/local/lib/systemd/system/{{ item }}"
...@@ -29,13 +29,19 @@ ...@@ -29,13 +29,19 @@
group: "root" group: "root"
loop: loop:
- "nfs_timeout_notification.service" - "nfs_timeout_notification.service"
- "nfs_timeout_notification_stop.service"
- "nfs_timeout_notification_start.timer"
- "nfs_timeout_notification_stop.timer"
notify: daemon-reload notify: daemon-reload
- name: install NFS monitoring services (3/3) - enable service - name: install NFS monitoring services (3/3) - enable services & timers
ansible.builtin.systemd_service: ansible.builtin.systemd_service:
name: "{{ item.name }}" name: "{{ item.name }}"
enabled: "{{ item.enabled | default(true) }}" enabled: "{{ item.enabled | default(true) }}"
state: "{{ item.state | default('started') }}" state: "{{ item.state | default('started') }}"
daemon_reload: true daemon_reload: true
loop: loop:
- name: "nfs_timeout_notification.service" - { name: "nfs_timeout_notification.service" }
- { name: "nfs_timeout_notification_stop.service", state: "stopped" }
- { name: "nfs_timeout_notification_start.timer" }
- { name: "nfs_timeout_notification_stop.timer" }
\ No newline at end of file
[Unit]
Description=timer for nfs_timeout_notification.service
[Timer]
# run on the 1st Tuesday of each month
# You can validate your calendar expressions using `systemd-analyze calendar EXPR`.
# Of course, the expression we use on our Debian systems won't work on the
# jurassic RHEL versions of systemd 219, because the ".." syntax for timespans
# in calendar events isn't supported yet. Instead, we have to use the older
# syntax that explicitly lists all days separated by commas.
# One more reason for RHEL to fuck ALL THE WAY OFF!
# OnCalendar=Tue *-*-01..07 08:00:00 # NOT THIS on RHEL 7!
OnCalendar=Tue *-*-01,02,03,04,05,06,07 15:00:00
Unit=nfs_timeout_notification.service
[Install]
WantedBy=default.target
[Unit]
Description=stop monitor journal for NFS timeouts and notify staff
After=remote-fs.target
Conflicts=nfs_timeout_notification.service
[Service]
Type=simple
Restart=no
ExecStart=/usr/bin/true
User={{ vault_nfs_timeout_notification_service.owner }}
Group={{ vault_nfs_timeout_notification_service.group }}
### Security features
# documented at https://www.freedesktop.org/software/systemd/man/systemd.exec.html
# or at `man (5) systemd.exec`
ProtectSystem=full
ProtectHome=read-only
#ProtectHostname=true
#ProtectClock=true
#ProtectKernelTunables=true
#ProtectKernelModules=true
#ProtectKernelLogs=true
#ProtectControlGroups=true
#LockPersonality=true
#MemoryDenyWriteExecute=true
#RestrictRealtime=true
#RestrictSUIDSGID=true
## RemoveIPC=true
## PrivateMounts=true
## MountFlags=
## SystemCallFilter is a Whitelist!!!
#SystemCallFilter=@debug,@file-system
#SystemCallErrorNumber=1337
[Install]
WantedBy=multi-user.target
[Unit]
Description=timer for nfs_timeout_notification_stop.service
[Timer]
# run on the 1st Tuesday of each month
# You can validate your calendar expressions using `systemd-analyze calendar EXPR`.
# Of course, the expression we use on our Debian systems won't work on the
# jurassic RHEL versions of systemd 219, because the ".." syntax for timespans
# in calendar events isn't supported yet. Instead, we have to use the older
# syntax that explicitly lists all days separated by commas.
# One more reason for RHEL to fuck ALL THE WAY OFF!
# OnCalendar=Tue *-*-01..07 08:00:00 # NOT THIS on RHEL 7!
OnCalendar=Tue *-*-01,02,03,04,05,06,07 07:55:00
Unit=nfs_timeout_notification.service
[Install]
WantedBy=default.target
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment