Feat: rename templates and add borgmatic_name
This commit is contained in:
parent
c23bebed74
commit
2ffabd234a
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
- name: Borgmatic config
|
- name: Borgmatic config
|
||||||
template:
|
template:
|
||||||
src: borgmatic.config.yaml.j2
|
src: config.yaml.j2
|
||||||
dest: "{{ borgmatic_config_file }}"
|
dest: "{{ borgmatic_config_file }}"
|
||||||
mode: 644
|
mode: 644
|
||||||
|
|
||||||
@ -45,14 +45,14 @@
|
|||||||
|
|
||||||
- name: copy systemd service
|
- name: copy systemd service
|
||||||
template:
|
template:
|
||||||
src: borgmatic.service.j2
|
src: service.j2
|
||||||
dest: "/lib/systemd/system/borgmatic_{{ borgmatic_name }}.service"
|
dest: "/lib/systemd/system/borgmatic_{{ borgmatic_name }}.service"
|
||||||
mode: 644
|
mode: 644
|
||||||
notify: "reload systemd"
|
notify: "reload systemd"
|
||||||
|
|
||||||
- name: copy systemd timer for executing borgmatic after boot
|
- name: copy systemd timer for executing borgmatic after boot
|
||||||
template:
|
template:
|
||||||
src: borgmatic.afterboot.timer.j2
|
src: afterboot.timer.j2
|
||||||
dest: "/lib/systemd/system/borgmatic_{{ borgmatic_name }}.timer"
|
dest: "/lib/systemd/system/borgmatic_{{ borgmatic_name }}.timer"
|
||||||
notify: "reload systemd"
|
notify: "reload systemd"
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#jinja2: lstrip_blocks: "True", trim_blocks: "True"
|
||||||
|
{{ ansible_managed | comment }}
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Run borgmatic {{ borgmatic_name }} backup
|
Description=Run borgmatic {{ borgmatic_name }} backup
|
||||||
|
|
@ -102,7 +102,7 @@ storage:
|
|||||||
# also specify a prefix in the retention section to avoid accidental pruning of
|
# also specify a prefix in the retention section to avoid accidental pruning of
|
||||||
# archives with a different archive name format. And you should also specify a
|
# archives with a different archive name format. And you should also specify a
|
||||||
# prefix in the consistency section as well.
|
# prefix in the consistency section as well.
|
||||||
archive_name_format: '{hostname}-{now:%Y-%m-%d-%H%M%S}'
|
archive_name_format: '{hostname}-{{ borgmatic_name }}-{now:%Y-%m-%d-%H%M%S}'
|
||||||
|
|
||||||
# Bypass Borg error about a repository that has been moved.
|
# Bypass Borg error about a repository that has been moved.
|
||||||
relocated_repo_access_is_ok: {{ borgmatic_relocated_repo_access_is_ok }}
|
relocated_repo_access_is_ok: {{ borgmatic_relocated_repo_access_is_ok }}
|
||||||
@ -149,7 +149,7 @@ retention:
|
|||||||
# When pruning, only consider archive names starting with this prefix.
|
# When pruning, only consider archive names starting with this prefix.
|
||||||
# Borg placeholders can be used. See the output of "borg help placeholders" for
|
# Borg placeholders can be used. See the output of "borg help placeholders" for
|
||||||
# details. Default is "{hostname}-".
|
# details. Default is "{hostname}-".
|
||||||
prefix: '{hostname}-'
|
prefix: '{hostname}-{{ borgmatic_name }}'
|
||||||
|
|
||||||
# Consistency checks to run after backups. See
|
# Consistency checks to run after backups. See
|
||||||
# https://borgbackup.readthedocs.org/en/stable/usage.html#borg-check and
|
# https://borgbackup.readthedocs.org/en/stable/usage.html#borg-check and
|
||||||
@ -174,7 +174,7 @@ consistency:
|
|||||||
# When performing the "archives" check, only consider archive names starting with
|
# When performing the "archives" check, only consider archive names starting with
|
||||||
# this prefix. Borg placeholders can be used. See the output of
|
# this prefix. Borg placeholders can be used. See the output of
|
||||||
# "borg help placeholders" for details. Default is "{hostname}-".
|
# "borg help placeholders" for details. Default is "{hostname}-".
|
||||||
prefix: '{hostname}-'
|
prefix: '{hostname}-{{ borgmatic_name }}'
|
||||||
|
|
||||||
# Shell commands or scripts to execute before and after a backup or if an error has occurred.
|
# Shell commands or scripts to execute before and after a backup or if an error has occurred.
|
||||||
# IMPORTANT: All provided commands and scripts are executed with user permissions of borgmatic.
|
# IMPORTANT: All provided commands and scripts are executed with user permissions of borgmatic.
|
@ -1,3 +1,4 @@
|
|||||||
|
#jinja2: lstrip_blocks: "True", trim_blocks: "True"
|
||||||
{{ ansible_managed | comment }}
|
{{ ansible_managed | comment }}
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
Loading…
Reference in New Issue
Block a user