From 0a3637f1d4d9dfc4c140f8bfe3b53c4c79fcc4bd Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 29 Apr 2021 15:13:19 +0200 Subject: [PATCH] update restic systemd init --- tasks/distribution/Linux.yml | 14 +++++++++++++- vars/main.yml | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tasks/distribution/Linux.yml b/tasks/distribution/Linux.yml index 29a7af6..42188d1 100644 --- a/tasks/distribution/Linux.yml +++ b/tasks/distribution/Linux.yml @@ -82,7 +82,19 @@ - item.name is defined - item.scheduled | default(false) -- name: Enable restic timer +- name: Enable restic service + become: true + ansible.builtin.systemd: + name: "restic-{{ item.name | replace(' ', '') | string }}.service" + enabled: true + daemon_reload: true + with_items: '{{ restic_backups }}' + when: + - restic_create_cron + - item.name is defined + - item.scheduled | default(false) + +- name: Enable and start restic timer become: true ansible.builtin.systemd: name: "restic-{{ item.name | replace(' ', '') | string }}.timer" diff --git a/vars/main.yml b/vars/main.yml index 4fa0924..60b8937 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -10,5 +10,5 @@ restic_os_variables: paths: - 'vars' -playbook_version_number: 3 # should be int +playbook_version_number: 4 # should be int playbook_version_path: 'do1jlr.restic.version'