added gobackup state
This commit is contained in:
parent
e74f591f6f
commit
be5cb6fcf0
11
states/gobackup/config.sls
Normal file
11
states/gobackup/config.sls
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
{%- from "gobackup/map.jinja" import gobackup with context %}
|
||||
gobackup-config-dir:
|
||||
file.directory:
|
||||
- name: {{ gobackup.config_dir }}
|
||||
|
||||
gobackup-config-file:
|
||||
file.managed:
|
||||
- name: {{ gobackup.config_dir }}/gobackup.yml
|
||||
- source: salt://gobackup/templates/gobackup.yml.j2
|
||||
- template: jinja
|
15
states/gobackup/defaults.yaml
Normal file
15
states/gobackup/defaults.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
gobackup:
|
||||
enabled: true
|
||||
fetch_url: https://paulbsd-pub.s3.fr-par.scw.cloud/gobackup
|
||||
install_dir: /usr/local/bin
|
||||
config_dir: /etc/gobackup
|
||||
config:
|
||||
user: gobackup
|
||||
password: password
|
||||
store:
|
||||
type: local
|
||||
keep: 3
|
||||
path: /var/lib/gobackup
|
||||
compress:
|
||||
type: tgz
|
4
states/gobackup/init.sls
Normal file
4
states/gobackup/init.sls
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
include:
|
||||
- .install
|
||||
- .config
|
10
states/gobackup/install.sls
Normal file
10
states/gobackup/install.sls
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
{%- from "gobackup/map.jinja" import gobackup with context %}
|
||||
gobackup-bin:
|
||||
file.managed:
|
||||
- name: {{ gobackup.install_dir }}/gobackup
|
||||
- source: {{ gobackup.fetch_url }}/gobackup-{{ gobackup.os }}-{{ gobackup.arch }}
|
||||
- user: root
|
||||
- group: root
|
||||
- skip_verify: True
|
||||
- if_missing: {{ gobackup.install_dir }}/gobackup
|
3
states/gobackup/kernelmap.yaml
Normal file
3
states/gobackup/kernelmap.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
Linux:
|
||||
os: linux
|
14
states/gobackup/map.jinja
Normal file
14
states/gobackup/map.jinja
Normal file
@ -0,0 +1,14 @@
|
||||
{%- import_yaml "gobackup/defaults.yaml" as default_settings -%}
|
||||
|
||||
{%- set defaults = salt['grains.filter_by'](default_settings, default='gobackup') -%}
|
||||
|
||||
{%- import_yaml "gobackup/kernelmap.yaml" as kernelmap %}
|
||||
{%- import_yaml "gobackup/osarchmap.yaml" as osarchmap %}
|
||||
|
||||
{%- set gobackup = salt['pillar.get']('gobackup',
|
||||
default=defaults,
|
||||
merge=salt['grains.filter_by'](osarchmap, grain='osarch',
|
||||
merge=salt['grains.filter_by'](kernelmap, grain='kernel')
|
||||
)
|
||||
)
|
||||
-%}
|
21
states/gobackup/osarchmap.yaml
Normal file
21
states/gobackup/osarchmap.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
amd64:
|
||||
arch: amd64
|
||||
|
||||
arm64:
|
||||
arch: arm64
|
||||
|
||||
# 386:
|
||||
# arch: 386
|
||||
|
||||
# arm64:
|
||||
# arch: arm64
|
||||
|
||||
# armv6l:
|
||||
# arch: arm
|
||||
|
||||
# armv7l:
|
||||
# arch: arm
|
||||
|
||||
# armhf:
|
||||
# arch: arm
|
0
states/gobackup/templates/gobackup.yml.j2
Normal file
0
states/gobackup/templates/gobackup.yml.j2
Normal file
Loading…
Reference in New Issue
Block a user