2015-04-06 16:25:27 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
|
|
|
|
{## import settings from map.jinja ##}
|
2016-02-12 09:42:31 +01:00
|
|
|
{%- from "sysctl/map.jinja" import sysctl_settings with context -%}
|
2015-04-06 16:25:27 +02:00
|
|
|
|
2016-04-26 13:31:39 +02:00
|
|
|
{% if sysctl_settings.params is defined %}
|
|
|
|
{% for param_name, param in sysctl_settings.get('params').items() %}
|
|
|
|
{% if param is mapping %}
|
|
|
|
sysctl-present-{{ param_name }}:
|
|
|
|
sysctl.present:
|
|
|
|
- name: {{ param_name }}
|
|
|
|
- value: {{ param.value }}
|
|
|
|
{%- if param.config is defined %}
|
|
|
|
- config: {{ sysctl_settings.config.location }}/{{ param.config }}
|
|
|
|
{% endif -%}
|
|
|
|
{% else %}
|
|
|
|
sysctl-present-{{ param_name }}:
|
|
|
|
sysctl.present:
|
|
|
|
- name: {{ param_name }}
|
|
|
|
- value: {{ param }}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
|
|
|
{## Support for legacy pillar structure ##}
|
2016-06-16 08:36:15 +02:00
|
|
|
{%- if sysctl_settings.lookup is defined %}
|
|
|
|
{% if sysctl_settings.lookup.params2 is defined -%}
|
|
|
|
{%- for param_name, param in sysctl_settings.lookup.get('params2', {}).items() -%}
|
|
|
|
{%- if param is mapping %}
|
2016-02-11 15:16:46 +01:00
|
|
|
sysctl-present-{{ param_name }}:
|
|
|
|
sysctl.present:
|
|
|
|
- name: {{ param_name }}
|
|
|
|
- value: {{ param.value }}
|
2016-06-16 08:36:15 +02:00
|
|
|
{%- if param.config is defined %}
|
2016-02-11 15:16:46 +01:00
|
|
|
- config: {{ sysctl_settings.config.location }}/{{ param.config }}
|
2016-06-16 08:36:15 +02:00
|
|
|
{% endif -%}
|
2016-04-26 13:31:39 +02:00
|
|
|
{% endif -%}
|
2016-06-16 08:36:15 +02:00
|
|
|
{% endfor %}
|
2016-02-11 15:16:46 +01:00
|
|
|
|
2016-06-16 08:36:15 +02:00
|
|
|
{% else %}
|
2016-02-11 15:16:46 +01:00
|
|
|
|
2016-06-16 08:36:15 +02:00
|
|
|
{%- for param in sysctl_settings.lookup.get('params', {}) -%}
|
|
|
|
{%- if param is mapping %}
|
2015-04-06 16:25:27 +02:00
|
|
|
sysctl-present-{{ param.name }}:
|
|
|
|
sysctl.present:
|
|
|
|
- name: {{ param.name }}
|
2015-05-12 15:48:22 +02:00
|
|
|
- value: {{ param.value }}
|
2016-04-26 13:31:39 +02:00
|
|
|
{%- if param.config is defined %}
|
2015-04-06 16:25:27 +02:00
|
|
|
- config: {{ sysctl_settings.config.location }}/{{ param.config }}
|
2016-06-16 08:36:15 +02:00
|
|
|
{% endif -%}
|
2016-04-26 13:31:39 +02:00
|
|
|
{% endif -%}
|
2016-06-16 08:36:15 +02:00
|
|
|
{% endfor %}
|
|
|
|
{% endif -%}
|
2016-04-26 13:31:39 +02:00
|
|
|
{%- endif -%}
|
2016-02-12 09:42:31 +01:00
|
|
|
{%- endif -%}
|