mirror of
https://github.com/saltstack-formulas/sysctl-formula.git
synced 2026-07-15 17:20:12 +02:00
sysctl-formula
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
{% 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 -%}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{% set sysctl = salt['grains.filter_by']({
|
||||
'Arch': {
|
||||
'pkg' : 'procps-ng',
|
||||
'config_location' : '/etc/sysctl.d',
|
||||
},
|
||||
}, merge=salt['pillar.get']('sysctl:lookup')) %}
|
||||
Reference in New Issue
Block a user