Commit 5d360b33 authored by godog's avatar godog

Merge branch 'datasets-restore' into 'master'

base: create dataset restore unit

See merge request !85
parents f5192ef7 99502124
Pipeline #5707 passed with stage
in 3 minutes and 48 seconds
......@@ -49,6 +49,19 @@
mode: 0755
when: dataset_should_backup
- name: Create restore service unit
template:
src: "tabacco/restore-service.j2"
dest: "/etc/systemd/system/restore-{{ dataset_filename }}.service"
mode: 0444
when: dataset_should_backup
- name: Enable restore service unit
systemd:
name: "restore-{{ dataset_filename }}.service"
enabled: yes
when: dataset_should_backup
- name: Wipe dataset restore guard file
file:
path: "/var/lib/float/datasets/{{ dataset_filename }}.restore_guard"
......
{% set container_names = service.containers | default([]) | map(attribute='name') | map('regex_replace', '^(.*)$', 'docker-\\1.service') | list %}
{% set required_by = container_names | union(service.systemd_services | default([])) %}
[Unit]
Description=Restore dataset {{ dataset_name }}
Before={{ required_by | join(' ') }}
[Service]
ExecStart=/usr/lib/float/datasets/restore-{{ dataset_filename }}
Type=oneshot
RemainAfterExit=true
[Install]
RequiredBy={{ required_by | join(' ') }}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment