Skip to content
Snippets Groups Projects
Commit 0d003ee5 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

feat: automate maintenance shutdown of SubApp (issue #2297)

parent c33ce687
No related branches found
No related tags found
No related merge requests found
Pipeline #6253 failed
......@@ -249,9 +249,10 @@
group: "{{ vault_subapp_group }}"
# ZIH has monthly maintenance windows for their VMware environment, which also
# affects the Library Manager VMs used by SLUBArchiv.digital. To make sure
# there is no read access during that time, we shutdown the DisApp and start it
# afterwards using systemd timers.
# affects the Library Manager VMs used by SLUBArchiv.digital. This time window
# is also used for upgrading the OS and IBM packages on the storage servers. To
# make sure that there is no write/read access during that time, we shutdown
# the DisApp and SubApp and start them afterwards using systemd timers.
- name: create directory for SystemD units
ansible.builtin.file:
path: "/usr/local/lib/systemd/system/"
......@@ -259,7 +260,7 @@
state: directory
owner: "root"
group: "root"
- name: install DisApp maintenance services and timers
- name: install SubApp/DisApp maintenance services and timers
ansible.builtin.template:
src: "usr/local/lib/systemd/system/{{ item }}.j2"
dest: "/usr/local/lib/systemd/system/{{ item }}"
......@@ -270,7 +271,10 @@
- "disapp_maintenance_begin.service"
- "disapp_maintenance_begin.timer"
- "disapp_maintenance_end.timer"
- name: enable DisApp maintenance services and timers
- "subapp_maintenance_begin.service"
- "subapp_maintenance_begin.timer"
- "subapp_maintenance_end.timer"
- name: enable SubApp/DisApp maintenance services and timers
ansible.builtin.systemd:
name: "{{ item.name }}"
enabled: "{{ item.enabled | default(true) }}"
......@@ -281,3 +285,7 @@
state: "stopped"
- name: "disapp_maintenance_begin.timer"
- name: "disapp_maintenance_end.timer"
- name: "subapp_maintenance_begin.service"
state: "stopped"
- name: "subapp_maintenance_begin.timer"
- name: "subapp_maintenance_end.timer"
[Unit]
Description=stop SubApp for monthly maintenance at ZIH
After=remote-fs.target
Conflicts=subapp.service
[Service]
Type=simple
Restart=no
ExecStart=true
User={{ vault_subapp_user }}
Group={{ vault_subapp_group }}
### Security features
# documented at https://www.freedesktop.org/software/systemd/man/systemd.exec.html
# or at `man (5) systemd.exec`
ProtectSystem=strict
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 subapp_maintenance.service
[Timer]
# run on the 1st Tuesday of each month
# You can validate your calendar expressions using `systemd-analyze calendar EXPR`.
OnCalendar=Tue *-*-01..07 08:00:00
Unit=subapp_maintenance_begin
[Install]
WantedBy=default.target
[Unit]
Description=timer for subapp_maintenance.service
[Timer]
# run on the 1st Tuesday of each month
# You can validate your calendar expressions using `systemd-analyze calendar EXPR`.
OnCalendar=Tue *-*-01..07 08:00:00
Unit=subapp_maintenance_begin
[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