mirror of
https://github.com/saltstack-formulas/sysctl-formula.git
synced 2026-09-22 05:47:00 +02:00
Make the formula fully pillar driven/customizable
- split package and param into separate state files - use defaults.yml to specify all configurable options of the formula - setup map.jinja to read in defaults.yml, filter by os_family for Arch, and merge in sysctl:lookup pillar - Updated README
This commit is contained in:
+25
-6
@@ -1,6 +1,25 @@
|
||||
{% set sysctl = salt['grains.filter_by']({
|
||||
'Arch': {
|
||||
'pkg' : 'procps-ng',
|
||||
'config_location' : '/etc/sysctl.d',
|
||||
},
|
||||
}, merge=salt['pillar.get']('sysctl:lookup')) %}
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=jinja
|
||||
|
||||
{## Start with defaults from defaults.sls ##}
|
||||
{% import_yaml 'sysctl/defaults.yml' as default_settings %}
|
||||
|
||||
{## setup variable using grains['os_family'] based logic ##}
|
||||
{% set os_family_map = salt['grains.filter_by']({
|
||||
'Arch': {
|
||||
"config": {
|
||||
"location": '/etc/sysctl.d',
|
||||
}
|
||||
}
|
||||
}, grain="os_family")
|
||||
%}
|
||||
{## Merge the flavor_map to the default settings ##}
|
||||
{% do default_settings.sysctl.update(os_family_map) %}
|
||||
|
||||
{## Merge in sysctl:lookup pillar ##}
|
||||
{% set sysctl_settings = salt['pillar.get'](
|
||||
'sysctl:lookup',
|
||||
default=default_settings.sysctl,
|
||||
merge=True
|
||||
)
|
||||
%}
|
||||
|
||||
Reference in New Issue
Block a user