initial commit for borg state
This commit is contained in:
parent
4f7e38fb34
commit
0bae11b3eb
8
states/borg/defaults.yaml
Normal file
8
states/borg/defaults.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
borg:
|
||||
enabled: true
|
||||
working_dir: /opt/borg
|
||||
pip_pkgs:
|
||||
- llfuse
|
||||
- borgbackup
|
||||
jobs: {}
|
6
states/borg/init.sls
Normal file
6
states/borg/init.sls
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
include:
|
||||
- .pkgs
|
||||
- .install
|
||||
#- .config
|
||||
#- .schedule
|
11
states/borg/install.sls
Normal file
11
states/borg/install.sls
Normal 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
8
states/borg/map.jinja
Normal 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
8
states/borg/pkgs.sls
Normal 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 %}
|
Loading…
Reference in New Issue
Block a user