initial commit for borg state

This commit is contained in:
Paul 2020-09-22 20:06:32 +02:00
parent 4f7e38fb34
commit 0bae11b3eb
5 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,8 @@
---
borg:
enabled: true
working_dir: /opt/borg
pip_pkgs:
- llfuse
- borgbackup
jobs: {}

6
states/borg/init.sls Normal file
View File

@ -0,0 +1,6 @@
---
include:
- .pkgs
- .install
#- .config
#- .schedule

11
states/borg/install.sls Normal file
View File

@ -0,0 +1,11 @@
---
{%- from "borg/map.jinja" import borg with context %}
borg-working-dir:
file.directory:
- name: {{ borg.working_dir }}
{% for dir in ['bin', 'logs', 'scripts'] %}
borg-working-dir-{{ dir }}:
file.directory:
- name: {{ borg.working_dir }}/{{ dir }}
{% endfor %}

8
states/borg/map.jinja Normal file
View File

@ -0,0 +1,8 @@
{%- import_yaml "borg/defaults.yaml" as defaults -%}
{%- set borg = salt['pillar.get'](
'borg',
default=defaults.borg,
merge=True
)
-%}

8
states/borg/pkgs.sls Normal file
View File

@ -0,0 +1,8 @@
---
{%- from "borg/map.jinja" import borg with context %}
{%- for pkg in borg.pip_pkgs %}
borg-pkg-reqs-{{ pkg }}:
pip.installed:
- name: {{ pkg }}
{%- endfor %}