diff --git a/tasks/configure_maintenance.yml b/tasks/configure_maintenance.yml new file mode 100644 index 0000000000000000000000000000000000000000..90a0036c34511cb0ce3ecb1b4b7a98b6156d228d --- /dev/null +++ b/tasks/configure_maintenance.yml @@ -0,0 +1,44 @@ +--- +# ZIH has monthly maintenance windows for their VMware environment, which also +# 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/" + mode: "0755" + state: directory + owner: "root" + group: "root" + +- 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 }}" + mode: "0644" + owner: "root" + group: "root" + loop: + - "disapp_maintenance_begin.service" + - "disapp_maintenance_begin.timer" + - "disapp_maintenance_end.timer" + - "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) }}" + state: "{{ item.state | default('started') }}" + daemon_reload: true + loop: + - name: "disapp_maintenance_begin.service" + 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" diff --git a/tasks/install_subapp.yml b/tasks/install_subapp.yml index 8b892792483fc64ce4d2dbeff5c58600fb3e74dc..1939f003d0ca132981e1f244cb079baf56aa9db8 100644 --- a/tasks/install_subapp.yml +++ b/tasks/install_subapp.yml @@ -213,48 +213,3 @@ dest: "/home/{{ vault_subapp_user }}/.subapp/subapp_ws_logs" owner: "{{ vault_subapp_user }}" group: "{{ vault_subapp_group }}" - -# ZIH has monthly maintenance windows for their VMware environment, which also -# 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/" - mode: "0755" - state: directory - owner: "root" - group: "root" - tags: [ maintenance_window ] -- 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 }}" - mode: "0644" - owner: "root" - group: "root" - loop: - - "disapp_maintenance_begin.service" - - "disapp_maintenance_begin.timer" - - "disapp_maintenance_end.timer" - - "subapp_maintenance_begin.service" - - "subapp_maintenance_begin.timer" - - "subapp_maintenance_end.timer" - tags: [ maintenance_window ] -- name: enable SubApp/DisApp maintenance services and timers - ansible.builtin.systemd: - name: "{{ item.name }}" - enabled: "{{ item.enabled | default(true) }}" - state: "{{ item.state | default('started') }}" - daemon_reload: true - loop: - - name: "disapp_maintenance_begin.service" - 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" - tags: [ maintenance_window ] diff --git a/tasks/main.yml b/tasks/main.yml index 4ecbe0762944c4b732730ce7cb43aa1c8247bfd0..545f833a662f9dbae73a984cdfcc7aa0cdef31be 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -48,6 +48,10 @@ ansible.builtin.import_tasks: "install_subapp.yml" tags: [subapp] +- name: configure SubApp/DisApp maintenance timer + ansible.builtin.import_tasks: "configure_maintenance.yml" + tags: [subapp, maintenance, systemd, timer, cron, cronjob] + - name: Userbezogene Konfiguration für User processing einspielen ansible.builtin.import_tasks: "configure_processing_user.yml" tags: [users, bash]