Commit 7d77b065 authored by Francesco Gionghi's avatar Francesco Gionghi

first

parents
sanoidconfig:
template:
- name: production
properties:
frequently: 0
hourly: 24
daily: 7
weekly: 2
monthly: 0
yearly: 0
autosnap: yes
autoprune: yes
- name: no-backup
properties:
frequently: 0
hourly: 0
dataset:
- name: data/home
properties:
use_template: production
- name: data/tmp
properties:
use_template: no-backup
\ No newline at end of file
{#- Get the `tplroot` from `tpldir` #}
{%- set sssdroot = slspath.split('/')[0] %}
{%- from sssdroot ~ "/map.jinja" import sssd with context %}
/etc/sanoid/sanoid.conf:
file.managed:
- contents: |
{% set config = pillar.get('sanoidconfig') %}
{% for dataset in config.dataset %}
[{{dataset.name}}]
{% for name, val in dataset.properties %}
{{name}} = {{val}}
{% endfor %}
{% endfor %}
{% for template in config.template %}
[template_{{template.name}}]
{% for name, val in template.properties %}
{{name}} = {{val}}
{% endfor %}
{% endfor %}
include:
- .config
\ No newline at end of file
sssd: {}
\ No newline at end of file
include:
- .config
\ No newline at end of file
# -*- coding: utf-8 -*-
# vim: ft=jinja
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{#- Start imports as #}
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
{%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap %}
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
{%- import_yaml tplroot ~ "/osmap.yaml" as osmap %}
{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %}
{#- Retrieve the config dict only once #}
{%- set _config = salt['config.get'](tplroot, default={}) %}
{%- set defaults = salt['grains.filter_by'](
default_settings,
default=tplroot,
merge=salt['grains.filter_by'](
osarchmap,
grain='osarch',
merge=salt['grains.filter_by'](
osfamilymap,
grain='os_family',
merge=salt['grains.filter_by'](
osmap,
grain='os',
merge=salt['grains.filter_by'](
osfingermap,
grain='osfinger',
merge=salt['grains.filter_by'](
_config,
default='lookup'
)
)
)
)
)
)
%}
{%- set config = salt['grains.filter_by'](
{'defaults': defaults},
default='defaults',
merge=_config
)
%}
{%- set sanoid = config %}
---
amd64:
arch: amd64
x86_64:
arch: amd64
386:
arch: 386
arm64:
arch: arm64
armv6l:
arch: armv6l
armv7l:
arch: armv7l
ppc64le:
arch: ppc64le
s390x:
arch: s390x
\ No newline at end of file
Debian: {}
RedHat: {}
Suse: {}
Gentoo: {}
Arch: {}
Alpine: {}
FreeBSD: {}
OpenBSD: {}
Solaris: {}
Windows: {}
MacOS: {}
\ No newline at end of file
Debian-10: {}
Debian-9: {}
Debian-8: {}
# os: Ubuntu
Ubuntu-18.04: {}
Ubuntu-20.04: {}
Ubuntu-16.04: {}
# os: Fedora
Fedora-31: {}
Fedora-30: {}
# os: CentOS
CentOS Linux-8: {}
CentOS Linux-7: {}
CentOS-6: {}
# os: Amazon
Amazon Linux-2: {}
Amazon Linux AMI-2018: {}
# os: SUSE
Leap-15: {}
# os: FreeBSD
FreeBSD-12: {}
# os: Windows
Windows-8.1: {}
# os: Gentoo
Gentoo-2: {}
\ No newline at end of file
# os_family: Debian
Ubuntu: {}
# os_family: RedHat
Fedora: {}
CentOS: {}
Amazon: {}
# os_family: Suse
SUSE: {}
openSUSE: {}
# os_family: Gentoo
Funtoo: {}
# os_family: Arch
Manjaro: {}
# os_family: Solaris
SmartOS: {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment