mirror of
https://github.com/saltstack-formulas/sysctl-formula.git
synced 2026-09-21 04:12:30 +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:
+5
-22
@@ -1,23 +1,6 @@
|
||||
{% from "sysctl/map.jinja" import sysctl with context %}
|
||||
|
||||
sysctl:
|
||||
pkg.installed:
|
||||
- name: {{ sysctl.pkg|json }}
|
||||
|
||||
{%- set config = pillar.get("sysctl", {} )%}
|
||||
{%- for name, item in config.get('params', {}).items() %}
|
||||
{%- if item == None -%}
|
||||
{% set item = {} -%}
|
||||
{%- endif -%}
|
||||
{%- set value = item.get('value', {}) %}
|
||||
{%- set config = item.get('config') %}
|
||||
|
||||
{{ name }}:
|
||||
sysctl.present:
|
||||
- name: {{ name }}
|
||||
- value: {{ value }}
|
||||
{%- if 'config' in item %}
|
||||
- config: {{ sysctl.config_location}}/{{ config }}
|
||||
{%- endif %}
|
||||
{%- endfor -%}
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
|
||||
include:
|
||||
- sysctl.package
|
||||
- sysctl.param
|
||||
|
||||
Reference in New Issue
Block a user