This repository has been archived on 2023-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
salt-states_old/restic/repository.sls

28 lines
854 B
Plaintext
Raw Normal View History

2022-11-02 12:51:59 +00:00
{% set escape_command = [ "systemd-escape -p", pillar['restic']['repository']['mount']]|join(" ") %}
{% set unit_name = salt['cmd.shell'](escape_command) %}
Create restic repository mount unit:
file.managed:
- name: /etc/systemd/system/{{ unit_name }}.mount
- source: salt://restic/files/restic.mount.jinja
- template: jinja
- user: root
- group: root
- mode: "0644"
Create restic repository automount unit:
file.managed:
- name: /etc/systemd/system/{{ unit_name }}.automount
- source: salt://restic/files/restic.automount.jinja
- template: jinja
- user: root
- group: root
- mode: "0644"
Run systemd daemon reload for repository:
cmd.run:
- name: systemctl daemon-reload
- onchanges:
- file: Create restic repository mount unit
- file: Create restic repository automount unit